主题化 GtkNotebook(选项卡面板)

发布于 2024-12-14 10:12:17 字数 612 浏览 4 评论 0原文

我正在尝试自定义主题 - 我想删除我在 xfce 中使用的主题的圆角。

在 gtkrc 中,

style "clearlooks-notebook-bg"
{
  bg[NORMAL] = @bg_color
}

style "clearlooks-notebook" = "clearlooks-notebook-bg"
{
  xthickness = 5
  ythickness = 0
}

这些不是我正在寻找的属性..所以我浏览到 http://developer.gnome.org/gtk/stable/GtkNotebook.html#GtkNotebook.style-properties 确实什么都没有我看到这将我引向面板。

我看到 /usr/lib/gtk-2.0/2.10.0/engines/libclearlooks.so 但我不知道主题文件位于何处(xubuntu),以便我可以看到clearlooks 如何处理选项卡的样式。

请指点

I'm trying to customize a theme - I want to remove the rounded corners for a theme I'm using in xfce.

In the gtkrc

style "clearlooks-notebook-bg"
{
  bg[NORMAL] = @bg_color
}

style "clearlooks-notebook" = "clearlooks-notebook-bg"
{
  xthickness = 5
  ythickness = 0
}

Those aren't the properties I'm looking for..so I browse over to http://developer.gnome.org/gtk/stable/GtkNotebook.html#GtkNotebook.style-properties and there really isn't anything I am seeing that points me to the panels.

I see /usr/lib/gtk-2.0/2.10.0/engines/libclearlooks.so but I don't know where the theme files are located (xubuntu) so that I can see how clearlooks is handling the style of the tabs.

Pointers please

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

烏雲後面有陽光 2024-12-21 10:12:17

主题资源文件即gtkrc一般位于/usr/share/themes//gtk-2.0/下。对于 Fedora 15 上的 Clearlooks,我可以在 /usr/share/themes/Clearlooks/gtk-2.0/ 下看到 gtkrc
您正在寻找的内容无法通过 gtkrc 文件中的简单更改来实现。你必须明白 Clearlooks 提供了一个 Gtk Engine (/usr/lib/ gtk-2.0/2.10.0/engines/libclearlooks.so 是可加载模块,其中实现了 Clearlooks 主题的 Gtk 引擎)以及主题资源文件。 Gtk引擎负责绘图功能的实现。这些绘图函数会覆盖 gtk+ 库提供的函数(Gtk 中的 GtkStyle、GtkRCStyle 源文件),因此您需要更新 Clearlooks 的源代码才能更改外观。源代码不是很大(大约 10 个文件左右)!要获取系统上 Clearlooks Gtk Engine 的源代码,请检查 Clearlooks 的软件包名称 (dpkg -S /usr/lib/gtk-2.0/2.10.0/engines/libclearlooks.so) & ;获取包的源代码(apt-get source)。修改源代码(查找draw_*/clearlooks_draw_*函数,clearlooks有绘制圆角矩形的代码,因此draw_*/clearlooks_draw_ * 函数根据需要绘制圆角矩形,因此将其更改为绘制普通矩形)、构建、安装和;享受新的锋利的非圆角标签的乐趣!
希望这有帮助!

Theme resource file i.e. gtkrc is generally located under /usr/share/themes/<theme-name>/gtk-2.0/. For Clearlooks on Fedora 15, I can see gtkrc under /usr/share/themes/Clearlooks/gtk-2.0/.
What you are looking for cannot be achieved simple change in the gtkrc file. You have to understand that Clearlooks provides a Gtk Engine (/usr/lib/gtk-2.0/2.10.0/engines/libclearlooks.so is loadable module with the implementation of Gtk Engine for Clearlooks theme) along with theme resource file. Gtk Engine is responsible for implementation of drawing functions. These drawing functions override the ones provided by gtk+ library (GtkStyle, GtkRCStyle source files in Gtk) Thus you need to update the source of Clearlooks for changing the appearance. Source code is not very large (about ~10 files or so)! To get the source code of Clearlooks Gtk Engine on your system, check the package name for clearlooks (dpkg -S /usr/lib/gtk-2.0/2.10.0/engines/libclearlooks.so) & get the source for the package (apt-get source <clearlooks-package-name>). Modify the source code (look for draw_*/clearlooks_draw_* functions, clearlooks has code for drawing rounded rectangle thus draw_*/clearlooks_draw_* functions draw rounded rectangle as needed so change it to draw normal rectangle instead), build, install & have fun with new sharp unrounded tab corners!
Hope this helps!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文