def __init__(self, icon_name='color-preview', **kwargs): self._accelerator = None self._tooltip = None self._palette_invoker = ToolInvoker() self._palette = None gobject.GObject.__init__(self, **kwargs) # The gtk.ToolButton has already added a normal button. # Replace it with a ColorButton color_button = _ColorButton(icon_name=icon_name, has_invoker=False) self.add(color_button) # The following is so that the behaviour on the toolbar is correct. color_button.set_relief(gtk.RELIEF_NONE) color_button.icon_size = gtk.ICON_SIZE_LARGE_TOOLBAR self._palette_invoker.attach_tool(self) # This widget just proxies the following properties to the colorbutton color_button.connect('notify::color', self.__notify_change) color_button.connect('notify::icon-name', self.__notify_change) color_button.connect('notify::icon-size', self.__notify_change) color_button.connect('notify::title', self.__notify_change) color_button.connect('color-set', self.__color_set_cb) color_button.connect('can-activate-accel', self.__button_can_activate_accel_cb)
def __init__(self, named_icon=None): gtk.ToggleToolButton.__init__(self) self._palette_invoker = ToolInvoker(self) self.set_named_icon(named_icon) self.connect('destroy', self.__destroy_cb)
def set_page(self, page): if page is None: self.page_widget = None return self.page_widget, alignment_ = _embed_page(_Box, page) self.page_widget.set_size_request(-1, style.GRID_CELL_SIZE) page.show() if self.props.palette is None: self.props.palette = _ToolbarPalette(invoker=ToolInvoker(self)) self._move_page_to_palette()
def __init__(self, **kwargs): self._accelerator = None self._tooltip = None self._xo_color = None self._palette_invoker = ToolInvoker() gobject.GObject.__init__(self, **kwargs) self._palette_invoker.attach_tool(self) self.connect('destroy', self.__destroy_cb)
def __init__(self, icon_name=None, xo_color=None): gtk.ToolItem.__init__(self) self._icon_widget = _IconWidget(icon_name, xo_color) self.add(self._icon_widget) self._icon_widget.show() self._palette_invoker = ToolInvoker(self) self.set_size_request(style.GRID_CELL_SIZE, style.GRID_CELL_SIZE) self.connect('destroy', self.__destroy_cb)
def __init__(self, icon_name=None, **kwargs): self._accelerator = None self._tooltip = None self._palette_invoker = ToolInvoker() gobject.GObject.__init__(self, **kwargs) self._palette_invoker.attach_tool(self) if icon_name: self.set_icon(icon_name) self.get_child().connect('can-activate-accel', self.__button_can_activate_accel_cb) self.connect('destroy', self.__destroy_cb)