diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2012-11-23 12:35:03 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2012-11-23 12:35:03 (GMT) |
commit | bbede53e28653119a8269c6d1e61cf1cf66f4a9e (patch) | |
tree | 256b740ca8c6b46c0e0fa91b4568173d13355ab7 | |
parent | d000b7943d0b654330771c346204b7edb363bb8f (diff) |
Revert "Use the new lockable Palette"
This reverts commit 63d4ce3311cff113f6c46ab4b656a9a101fc0aac.
The patch pushed was not the right version
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
-rw-r--r-- | widgets.py | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -47,6 +47,7 @@ class BrushButton(_ColorButton): GObject.GObject.__init__(self, **kwargs) self._preview.set_events(Gdk.EventMask.BUTTON_PRESS_MASK) + self._preview.connect('button_press_event', self.__mouse_down_cb) self._preview.connect("draw", self.draw) self.set_image(self._preview) @@ -166,6 +167,15 @@ class BrushButton(_ColorButton): def get_icon_size(self): pass + def __mouse_down_cb(self, event): + if self._palette: + if not self._palette.is_up(): + self._palette.popup(immediate=True, + state=self._palette.SECONDARY) + else: + self._palette.popdown(immediate=True) + return True + class ButtonStrokeColor(Gtk.ToolItem): """Class to manage the Stroke Color of a Button""" @@ -196,8 +206,6 @@ class ButtonStrokeColor(Gtk.ToolItem): self.color_button.set_relief(Gtk.ReliefStyle.NONE) self._palette_invoker.attach_tool(self) - self._palette_invoker.props.toggle_palette = True - self._palette_invoker.props.lock_palette = True # This widget just proxies the following properties to the colorbutton self.color_button.connect('notify::color', self.__notify_change) |