preferences.py 文件源码

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

项目:draobpilc 作者: awamper 项目源码 文件源码
def _on_button_clicked(self, button):
        dialog = Gtk.Dialog()
        dialog.set_transient_for(self)

        gpaste_settings = GPaste.SettingsUiWidget()

        for child in gpaste_settings.get_children():
            if isinstance(child, Gtk.StackSwitcher):
                toplevel = dialog.get_toplevel()
                if not toplevel: continue

                gpaste_settings.remove(child)

                header_bar = Gtk.HeaderBar()
                header_bar.set_show_close_button(True)
                header_bar.set_title(None)
                header_bar.set_subtitle(None)
                header_bar.set_custom_title(child)

                toplevel.set_titlebar(header_bar)

            if isinstance(child, Gtk.Stack):
                child.set_transition_type(
                    Gtk.StackTransitionType.SLIDE_LEFT_RIGHT
                )
                child.set_transition_duration(self._transition_duration)

        content_area = dialog.get_content_area()
        content_area.add(gpaste_settings)

        dialog.show_all()
        dialog.run()
        dialog.destroy()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号