本文整理汇总了Python中sugar3.graphics.palettewindow.PaletteWindow类的典型用法代码示例。如果您正苦于以下问题:Python PaletteWindow类的具体用法?Python PaletteWindow怎么用?Python PaletteWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了PaletteWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: popup
def popup(self, immediate=False):
button = self.expanded_button
if button.is_expanded():
return
box = button.toolbar_box
_setup_page(button.page_widget, style.COLOR_BLACK.get_gdk_color(), box.props.padding)
PaletteWindow.popup(self, immediate)
开发者ID:rogemita,项目名称:sugar-toolkit-gtk3,代码行数:7,代码来源:toolbarbox.py
示例2: popdown
def popdown(self, immediate=False):
if immediate:
self._secondary_anim.stop()
# to suppress glitches while later re-opening
self.set_palette_state(self.PRIMARY)
if self._widget:
self._widget.size_request()
PaletteWindow.popdown(self, immediate)
开发者ID:worr,项目名称:sugar-toolkit-gtk3-1,代码行数:8,代码来源:palette.py
示例3: __init__
def __init__(self, **kwargs):
PaletteWindow.__init__(self, **kwargs)
self._has_focus = False
group = palettegroup.get_group('default')
group.connect('popdown', self.__group_popdown_cb)
self.set_group_id('toolbarbox')
self._widget = _PaletteWindowWidget()
self._widget.set_border_width(0)
self._setup_widget()
self._widget.connect('realize', self._realize_cb)
开发者ID:ceibal-tatu,项目名称:sugar-toolkit-gtk3,代码行数:13,代码来源:toolbarbox.py
示例4: popup
def popup(self, immediate=False, state=None):
if self._invoker is not None:
self._update_full_request()
PaletteWindow.popup(self, immediate)
if state is None:
state = self.PRIMARY
self.set_palette_state(state)
if state == self.PRIMARY:
self._secondary_anim.start()
else:
self._secondary_anim.stop()
开发者ID:worr,项目名称:sugar-toolkit-gtk3-1,代码行数:14,代码来源:palette.py
示例5: popdown
def popdown(self, immediate=False, state=None):
'''
Popdown (or show the full contents of) the palette.
Keyword Args:
immediate (bool): if True, the palette will be shown instantly (as
if the user right clicked the item). If False, the palette
will be shown after the usual activation wait time.
.. deprecated:: 0.109
The state keyword argument is deprecated. The old
secondary state has become the only state.
'''
if immediate:
if self._widget:
self._widget.size_request()
PaletteWindow.popdown(self, immediate)
开发者ID:i5o,项目名称:sugar-toolkit-gtk3,代码行数:17,代码来源:palette.py
示例6: on_enter
def on_enter(self):
PaletteWindow.on_enter(self)
self._secondary_anim.start()
开发者ID:worr,项目名称:sugar-toolkit-gtk3-1,代码行数:3,代码来源:palette.py
示例7: _setup_widget
def _setup_widget(self):
PaletteWindow._setup_widget(self)
self._widget.connect('destroy', self.__destroy_cb)
开发者ID:worr,项目名称:sugar-toolkit-gtk3-1,代码行数:3,代码来源:palette.py
示例8: __init__
def __init__(self, label=None, accel_path=None,
text_maxlen=60, **kwargs):
# DEPRECATED: label is passed with the primary-text property,
# accel_path is set via the invoker property
self._primary_text = None
self._secondary_text = None
self._icon = None
self._icon_visible = True
self._palette_state = self.PRIMARY
self._primary_box = Gtk.HBox()
self._primary_box.show()
self._icon_box = Gtk.HBox()
self._icon_box.set_size_request(style.GRID_CELL_SIZE, -1)
self._primary_box.pack_start(self._icon_box, False, True, 0)
labels_box = Gtk.VBox()
self._label_alignment = Gtk.Alignment(xalign=0, yalign=0.5, xscale=1,
yscale=0.33)
self._label_alignment.set_padding(0, 0, style.DEFAULT_SPACING,
style.DEFAULT_SPACING)
self._label_alignment.add(labels_box)
self._label_alignment.show()
self._primary_box.pack_start(self._label_alignment, True, True, 0)
labels_box.show()
self._label = Gtk.AccelLabel(label='')
self._label.set_alignment(0, 0.5)
if text_maxlen > 0:
self._label.set_max_width_chars(text_maxlen)
self._label.set_ellipsize(Pango.EllipsizeMode.MIDDLE)
labels_box.pack_start(self._label, True, True, 0)
self._secondary_label = Gtk.Label()
self._secondary_label.set_alignment(0, 0.5)
if text_maxlen > 0:
self._secondary_label.set_max_width_chars(text_maxlen)
self._secondary_label.set_ellipsize(Pango.EllipsizeMode.END)
labels_box.pack_start(self._secondary_label, True, True, 0)
self._secondary_box = Gtk.VBox()
self._separator = Gtk.HSeparator()
self._secondary_box.pack_start(self._separator, True, True, 0)
self._secondary_anim = animator.Animator(2.0, 10)
self._secondary_anim.add(_SecondaryAnimation(self))
# we init after initializing all of our containers
PaletteWindow.__init__(self, **kwargs)
self._full_request = [0, 0]
self._content = None
# we set these for backward compatibility
if label is not None:
self.props.primary_text = label
self._add_content()
self.action_bar = PaletteActionBar()
self._secondary_box.pack_start(self.action_bar, True, True, 0)
self.action_bar.show()
self.connect('notify::invoker', self.__notify_invoker_cb)
self.connect('popdown', self.__popdown_cb)
# Default to a normal window palette
self._content_widget = None
self.set_content(None)
开发者ID:worr,项目名称:sugar-toolkit-gtk3-1,代码行数:75,代码来源:palette.py
示例9: on_leave
def on_leave(self):
PaletteWindow.on_enter(self)
self._set_focus(False)
开发者ID:ceibal-tatu,项目名称:sugar-toolkit-gtk3,代码行数:3,代码来源:toolbarbox.py
示例10: on_enter
def on_enter(self):
PaletteWindow.on_enter(self)
self._set_focus(True)
开发者ID:ceibal-tatu,项目名称:sugar-toolkit-gtk3,代码行数:3,代码来源:toolbarbox.py
示例11: on_invoker_leave
def on_invoker_leave(self):
PaletteWindow.on_invoker_leave(self)
self._set_focus(False)
开发者ID:ceibal-tatu,项目名称:sugar-toolkit-gtk3,代码行数:3,代码来源:toolbarbox.py
示例12: on_enter
def on_enter(self):
PaletteWindow.on_enter(self)
开发者ID:i5o,项目名称:sugar-toolkit-gtk3,代码行数:2,代码来源:palette.py
示例13: popup
def popup(self, immediate=False):
if self._invoker is not None:
self._update_full_request()
PaletteWindow.popup(self, immediate)
开发者ID:i5o,项目名称:sugar-toolkit-gtk3,代码行数:5,代码来源:palette.py
示例14: __init__
def __init__(self, label=None, accel_path=None,
text_maxlen=style.MENU_WIDTH_CHARS, **kwargs):
# DEPRECATED: label is passed with the primary-text property,
# accel_path is set via the invoker property
self._primary_text = None
self._secondary_text = None
self._icon = None
self._icon_visible = True
self._primary_event_box = Gtk.EventBox()
self._primary_event_box.show()
self._primary_box = Gtk.HBox()
self._primary_event_box.add(self._primary_box)
self._primary_box.show()
self._icon_box = Gtk.HBox()
self._icon_box.set_size_request(style.GRID_CELL_SIZE, -1)
self._primary_box.pack_start(self._icon_box, False, True, 0)
labels_box = Gtk.VBox()
self._label_alignment = Gtk.Alignment(xalign=0, yalign=0.5, xscale=1,
yscale=0.33)
self._label_alignment.set_padding(
style.DEFAULT_SPACING, style.DEFAULT_SPACING,
style.DEFAULT_SPACING, style.DEFAULT_SPACING)
self._label_alignment.add(labels_box)
self._label_alignment.show()
self._primary_box.pack_start(self._label_alignment, True, True, 0)
labels_box.show()
self._label = Gtk.AccelLabel(label='')
self._label.set_alignment(0, 0.5)
if text_maxlen > 0:
self._label.set_max_width_chars(text_maxlen)
self._label.set_ellipsize(style.ELLIPSIZE_MODE_DEFAULT)
labels_box.pack_start(self._label, True, True, 0)
self._primary_event_box.connect('button-release-event',
self.__button_release_event_cb)
self._primary_event_box.set_events(Gdk.EventMask.BUTTON_RELEASE_MASK)
self._secondary_label = Gtk.Label()
self._secondary_label.set_alignment(0, 0.5)
labels_box.pack_start(self._secondary_label, True, True, 0)
self._secondary_box = Gtk.VBox()
self._separator = Gtk.HSeparator()
self._secondary_box.pack_start(self._separator, True, True, 0)
self._secondary_box.show()
# we init after initializing all of our containers
PaletteWindow.__init__(self, **kwargs)
self._full_request = [0, 0]
self._content = None
# we set these for backward compatibility
if label is not None:
self.props.primary_text = label
self._add_content()
self.action_bar = PaletteActionBar()
self._secondary_box.pack_start(self.action_bar, True, True, 0)
self.action_bar.show()
self.connect('notify::invoker', self.__notify_invoker_cb)
# Default to a normal window palette
self._content_widget = None
self.set_content(None)
开发者ID:i5o,项目名称:sugar-toolkit-gtk3,代码行数:73,代码来源:palette.py
示例15: popdown
def popdown(self, immediate=False):
if immediate:
if self._widget:
self._widget.size_request()
PaletteWindow.popdown(self, immediate)
开发者ID:AbrahmAB,项目名称:sugar-toolkit-gtk3,代码行数:5,代码来源:palette.py
注:本文中的sugar3.graphics.palettewindow.PaletteWindow类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论