From 0945bc540668218edf29388aa24d85a1c7dc75c3 Mon Sep 17 00:00:00 2001
From: Simon Schampijer <simon@laptop.org>
Date: Thu, 15 Nov 2012 19:02:51 +0100
Subject: [PATCH] Use the new lockable Palette
---
widgets.py | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/widgets.py b/widgets.py
index 46c8db2..4d9dae9 100644
a
|
b
|
class BrushButton(_ColorButton): |
47 | 47 | GObject.GObject.__init__(self, **kwargs) |
48 | 48 | self._preview.set_events(Gdk.EventMask.BUTTON_PRESS_MASK) |
49 | 49 | |
50 | | self._preview.connect('button_press_event', self.__mouse_down_cb) |
51 | 50 | self._preview.connect("draw", self.draw) |
52 | 51 | self.set_image(self._preview) |
53 | 52 | |
… |
… |
class BrushButton(_ColorButton): |
167 | 166 | def get_icon_size(self): |
168 | 167 | pass |
169 | 168 | |
170 | | def __mouse_down_cb(self, event): |
171 | | if self._palette: |
172 | | if not self._palette.is_up(): |
173 | | self._palette.popup(immediate=True, |
174 | | state=self._palette.SECONDARY) |
175 | | else: |
176 | | self._palette.popdown(immediate=True) |
177 | | return True |
178 | | |
179 | 169 | |
180 | 170 | class ButtonStrokeColor(Gtk.ToolItem): |
181 | 171 | """Class to manage the Stroke Color of a Button""" |
… |
… |
class ButtonStrokeColor(Gtk.ToolItem): |
206 | 196 | self.color_button.set_relief(Gtk.ReliefStyle.NONE) |
207 | 197 | |
208 | 198 | self._palette_invoker.attach_tool(self) |
| 199 | self._palette_invoker.props.toggle_palette = True |
| 200 | self._palette_invoker.props.lock_palette = True |
209 | 201 | |
210 | 202 | # This widget just proxies the following properties to the colorbutton |
211 | 203 | self.color_button.connect('notify::color', self.__notify_change) |