gtk3 GtkWindow标题栏颜色
使用gtk3,如何更改默认的GtkWindow标题栏颜色?会涉及GtkStyleContext吗?我只使用过 GtkCssProvider。
Using gtk3, how can I change the default GtkWindow titlebar color? Would it involve GtkStyleContext? I've only used GtkCssProvider.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您无法从 GTK 更改标题栏颜色。标题栏是由窗口管理器绘制的,GTK 对它一无所知。您只能通过“提示”与窗口管理器进行通信,例如窗口是否应该有标题栏或者应该在其中显示什么字符串,但窗口管理器可以随意忽略它们。
You can't change the titlebar color from GTK. The titlebar is drawn by the window manager, and GTK doesn't "know" anything about it. You can only communicate with the window manager through "hints", such as whether the window should have a titlebar or what string should be displayed there, but the window manager is free to ignore them.
你可以做到...
(至少在 Linux 上)
发生的情况是,您的窗口未被装饰,然后用标题栏“装饰”(恰好有一个该死的“show_close_button”,所以我猜这是预期用途)
You can do it...
( at least on Linux )
What happens is that your window is being un-decorated then "decorated" with a header bar ( which happens to have a bloody "show_close_button", so I guess this is an intended use )