def gtk_change_visuals(self, light_option="unchanged", theme="unchanged"):
if Gtk.MAJOR_VERSION >= 3 and Gtk.MINOR_VERSION >= 14:
css_filename = "gtk"
filename = ""
if theme == "metro" or theme == "paper":
self.gtk_theme = theme
if light_option == "gtk" or light_option == "gtk-dark":
self.lightsOption = light_option
filename = 'gui/' + self.gtk_theme + '/'+ self.lightsOption + '.css'
css = open(filename, 'r')
style_provider = Gtk.CssProvider()
css_data = css.read()
css.close()
style_provider.load_from_data(css_data)
Gtk.StyleContext.add_provider_for_screen(
Gdk.Screen.get_default(),
style_provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
)
评论列表
文章目录