main.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:MTTT 作者: roxana-lafuente 项目源码 文件源码
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
            )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号