主题化 GtkNotebook(选项卡面板)
我正在尝试自定义主题 - 我想删除我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
主题资源文件即
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 seegtkrc
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 fordraw_*
/clearlooks_draw_*
functions, clearlooks has code for drawing rounded rectangle thusdraw_*
/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!