preferences_dialog.py 文件源码

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

项目:Ebook-Viewer 作者: michaldaniel 项目源码 文件源码
def __populate_preferences(self):
        vbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
        hbox_theme = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=50)
        themes = ["Day (light)", "Night (dark)"]
        self.themes_combo = Gtk.ComboBoxText()
        self.themes_combo.set_entry_text_column(0)
        self.themes_combo.connect("changed", self.__on_themes_combo_changed)
        for theme in themes:
            self.themes_combo.append_text(theme)
        if self.window.config_provider.config["Application"]["stylesheet"] == "Day":
            self.themes_combo.set_active(0)
        else:
            self.themes_combo.set_active(1)
        hbox_theme.pack_end(self.themes_combo, False, True, 0)
        theme_label = Gtk.Label(_("Application theme") ,xalign=0)
        hbox_theme.pack_start(theme_label, False, True, 0)
        vbox.pack_start(hbox_theme, False, True, 0)
        try:
            vbox.set_margin_start(20)
            vbox.set_margin_end(20)
        except AttributeError:
            print("Gtk-WARNING **: GTK+ ver. below 3.12 will cause application interface to misbehave")
            vbox.set_margin_left(20)
            vbox.set_margin_right(20)
        vbox.set_margin_top(20)
        self.add(vbox)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号