Reputation: 629
Is there a way I could tell my python 3 application to use for example always the Adwaita theme (Gnome 3 default theme) with GTK?
Upvotes: 0
Views: 1178
Reputation: 2246
To force a specific Gtk theme, just load the css file:
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)
Upvotes: 2