當前位置: 首頁>>代碼示例>>Python>>正文


Python Theme.is_ascending方法代碼示例

本文整理匯總了Python中theme.Theme.is_ascending方法的典型用法代碼示例。如果您正苦於以下問題:Python Theme.is_ascending方法的具體用法?Python Theme.is_ascending怎麽用?Python Theme.is_ascending使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在theme.Theme的用法示例。


在下文中一共展示了Theme.is_ascending方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: MainWindow

# 需要導入模塊: from theme import Theme [as 別名]
# 或者: from theme.Theme import is_ascending [as 別名]
class MainWindow(object):
    def __init__(self, liststore):
        self.liststore = liststore

        self.gui = gui = Gtk.Builder()
        gui.add_from_file(SHARED_DATA_FILE("gfeedline.glade"))

        self.window = window = gui.get_object("main_window")
        self.column = MultiColumnDict(gui)  # multi-columns for Notebooks
        self.theme = Theme()
        self.font = FontSet()
        self.notification = StatusNotification(liststore)

        dnd_list = [Gtk.TargetEntry.new("text/uri-list", 0, 1), Gtk.TargetEntry.new("text/x-moz-url", 0, 4)]
        window.drag_dest_set(Gtk.DestDefaults.ALL, dnd_list, Gdk.DragAction.COPY)

        target = Gtk.TargetList.new([])
        target.add(Gdk.Atom.intern("text/x-moz-url", False), 0, 4)
        target.add(Gdk.Atom.intern("text/uri-list", False), 0, 1)

        window.drag_dest_set_target_list(target)
        window.connect("drag-data-received", self.on_drag_data_received)

        SETTINGS.connect("changed::window-sticky", self.on_settings_sticky_change)
        self.on_settings_sticky_change(SETTINGS, "window-sticky")

        SETTINGS_VIEW.connect("changed::theme", self.on_settings_theme_change)
        self.on_settings_theme_change(SETTINGS_VIEW, "theme")

        is_multi_column = SETTINGS_VIEW.get_boolean("multi-column")
        menuitem_multicolumn = gui.get_object("menuitem_multicolumn")
        menuitem_multicolumn.set_active(is_multi_column)

        menuitem_update = MenuItemUpdate(gui, liststore)

        x, y, w, h = self._get_geometry_from_settings()
        #        window.show() # for wrong position when auto-start

        if x >= 0 and y >= 0:
            window.move(x, y)

        window.resize(w, h)
        window.show()

        gui.connect_signals(self)

    def on_drag_data_received(self, widget, context, x, y, selection, info, time):
        text, image_file = DnDSelection.parse(info, selection, True)

        if text or image_file:
            updatewindow = UpdateWindow(self)

            if text:
                updatewindow.text_buffer.set_text(text)
            else:
                updatewindow.set_upload_media(image_file)

    def get_notebook(self, group_name):
        if not SETTINGS_VIEW.get_boolean("multi-column"):
            group_name = "dummy for single column"

        if group_name in self.column:
            notebook = self.column.get(group_name)
        else:
            notebook = FeedNotebook(self.column, group_name, self.liststore)
            self.column.add(group_name, notebook)

        return notebook

    def toggle_multicolumn_mode(self):
        for row in self.liststore:
            notebook = self.get_notebook(row[Column.GROUP])
            view = row[Column.API].view
            view.force_remove()
            view.append(notebook, -1)

        reactor.callLater(0.1, self._jump_all_tabs_to_bottom, self.theme.is_ascending())

    def _jump_all_tabs_to_bottom(self, is_bottom=True):
        for notebook in self.column.values():
            notebook.jump_all_tabs_to_bottom(is_bottom)

    def change_font(self, font=None, size=None):
        for notebook in self.column.values():
            notebook.change_font(font, size)

    def delete_status(self, status_id):
        js = 'hideStatus("%s")' % status_id

        for notebook in self.column.values():
            notebook.exec_js_all_views(js)

    def _get_geometry_from_settings(self):
        x = SETTINGS_GEOMETRY.get_int("window-x")
        y = SETTINGS_GEOMETRY.get_int("window-y")
        w = SETTINGS_GEOMETRY.get_int("window-width")
        h = SETTINGS_GEOMETRY.get_int("window-height")
        return x, y, w, h

    def on_window_leave_notify_event(self, widget, event):
#.........這裏部分代碼省略.........
開發者ID:yendo,項目名稱:gfeedline,代碼行數:103,代碼來源:window.py


注:本文中的theme.Theme.is_ascending方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。