有没有办法告诉我的python 3应用程序使用例如Adwaita主题(Gnome 3默认主题)和GTK?
答案 0 :(得分:2)
要强制使用特定的Gtk主题,只需加载css文件:
win_style_context = self.get_style_context()
css_provider = Gtk.CssProvider()
css_provider.load_from_path("/usr/share/themes/Adwaita/gtk-3.0/gtk.css")
screen = Gdk.Screen.get_default()
win_style_context.add_provider_for_screen(screen, css_provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION)