diff options
author | Simon Schampijer <simon@laptop.org> | 2012-11-23 09:26:51 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@laptop.org> | 2012-11-23 16:38:05 (GMT) |
commit | 6a01d9228d9fe8d01b9b4e202803c7733994b1a8 (patch) | |
tree | 43d0c1255c08aeb68e89054e206508071863edc5 | |
parent | 9c230ea498a710b1f577679717ca1b54dda4e9c8 (diff) |
Follow up fixes for the lockable Palette support
- do not call set_expanded when the parent does not
have that attribute, this is the case in the custom
abacus Palette in the Abacus activity
- add the same code in the button release event callback
that we have as well in the click event callback
Signed-off-by: Simon Schampijer <simon@laptop.org>
Acked-by: Manuel QuiƱones <manuq@laptop.org>
-rw-r--r-- | src/sugar3/graphics/palettewindow.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/sugar3/graphics/palettewindow.py b/src/sugar3/graphics/palettewindow.py index cadb4fe..7063681 100644 --- a/src/sugar3/graphics/palettewindow.py +++ b/src/sugar3/graphics/palettewindow.py @@ -1150,9 +1150,9 @@ class WidgetInvoker(Invoker): return False def __click_event_cb(self, button): - if self.props.lock_palette: - if not self.locked: - self.locked = True + if self.props.lock_palette and not self.locked: + self.locked = True + if hasattr(self.parent, 'set_expanded'): self.parent.set_expanded(True) if self.props.toggle_palette: @@ -1160,6 +1160,11 @@ class WidgetInvoker(Invoker): def __button_release_event_cb(self, widget, event): if event.button == 1 and not self._click_hid: + if self.props.lock_palette and not self.locked: + self.locked = True + if hasattr(self.parent, 'set_expanded'): + self.parent.set_expanded(True) + if self.props.toggle_palette: self.notify_toggle_state() elif event.button == 3: |