Fix that several palettes are not hooked up to the same button #3293
This commit is contained in:
parent
44ffef5f67
commit
8ae1f9aad8
1
NEWS
1
NEWS
@ -1,3 +1,4 @@
|
||||
* #3293 Fix that several palettes are not hooked up to the same button (erikos)
|
||||
* #3514 Remove invite when the activiy disappear from the mesh. (cassidy)
|
||||
* #3003 Make image drags on the clipboard work consistently. (marco)
|
||||
|
||||
|
@ -480,6 +480,8 @@ class CanvasIcon(hippo.CanvasBox, hippo.CanvasItem):
|
||||
return self._palette
|
||||
|
||||
def set_palette(self, palette):
|
||||
if self._palette is not None:
|
||||
self._palette.props.invoker = None
|
||||
self._palette = palette
|
||||
if not self._palette.props.invoker:
|
||||
self._palette.props.invoker = CanvasInvoker(self)
|
||||
|
@ -192,9 +192,16 @@ class Palette(gtk.Window):
|
||||
|
||||
def do_set_property(self, pspec, value):
|
||||
if pspec.name == 'invoker':
|
||||
if self._invoker is not None:
|
||||
self._invoker.disconnect(self._enter_invoker_hid)
|
||||
self._invoker.disconnect(self._leave_invoker_hid)
|
||||
|
||||
self._invoker = value
|
||||
self._invoker.connect('mouse-enter', self._invoker_mouse_enter_cb)
|
||||
self._invoker.connect('mouse-leave', self._invoker_mouse_leave_cb)
|
||||
if value is not None:
|
||||
self._enter_invoker_hid = self._invoker.connect(
|
||||
'mouse-enter', self._invoker_mouse_enter_cb)
|
||||
self._leave_invoker_hid = self._invoker.connect(
|
||||
'mouse-leave', self._invoker_mouse_leave_cb)
|
||||
else:
|
||||
raise AssertionError
|
||||
|
||||
|
@ -41,6 +41,8 @@ class RadioToolButton(gtk.RadioToolButton):
|
||||
return self._palette
|
||||
|
||||
def set_palette(self, palette):
|
||||
if self._palette is not None:
|
||||
self._palette.props.invoker = None
|
||||
self._palette = palette
|
||||
self._palette.props.invoker = ToolInvoker(self.child)
|
||||
|
||||
|
@ -37,6 +37,8 @@ class ToggleToolButton(gtk.ToggleToolButton):
|
||||
return self._palette
|
||||
|
||||
def set_palette(self, palette):
|
||||
if self._palette is not None:
|
||||
self._palette.props.invoker = None
|
||||
self._palette = palette
|
||||
self._palette.props.invoker = ToolInvoker(self.child)
|
||||
|
||||
|
@ -41,12 +41,14 @@ class ToolButton(gtk.ToolButton):
|
||||
return self._palette
|
||||
|
||||
def set_palette(self, palette):
|
||||
if self._palette is not None:
|
||||
self._palette.props.invoker = None
|
||||
self._palette = palette
|
||||
self._palette.props.invoker = ToolInvoker(self.child)
|
||||
|
||||
def set_tooltip(self, text):
|
||||
self.set_palette(Palette(text))
|
||||
|
||||
|
||||
def do_expose_event(self, event):
|
||||
if self._palette and self._palette.is_up():
|
||||
invoker = self._palette.props.invoker
|
||||
|
@ -216,6 +216,8 @@ class _IconWidget(gtk.EventBox):
|
||||
gtk.EventBox.do_expose_event(self, event)
|
||||
|
||||
def set_palette(self, palette):
|
||||
if self._palette is not None:
|
||||
self._palette.props.invoker = None
|
||||
self._palette = palette
|
||||
self._palette.props.invoker = ToolInvoker(self)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user