本文整理汇总了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):
#.........这里部分代码省略.........