Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Schampijer <simon@laptop.org>2012-11-27 13:41:55 (GMT)
committer Simon Schampijer <simon@laptop.org>2012-11-27 13:43:54 (GMT)
commit5a1b380dd6099d7455d67e00718388fa79b57e01 (patch)
treedea1c6d28c8291936be3613d7b18c803c2dbf4fe
parentf9467f936f2f5a134dd394845c31a76fb1347384 (diff)
RadioToolButton: hide tooltip on click, SL #4268
This is the same behaviour as with the ToolButton. Signed-off-by: Simon Schampijer <simon@laptop.org> Acked-by: Manuel QuiƱones <manuq@laptop.org>
-rw-r--r--src/sugar3/graphics/radiotoolbutton.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sugar3/graphics/radiotoolbutton.py b/src/sugar3/graphics/radiotoolbutton.py
index 4e27a8f..c04cdc8 100644
--- a/src/sugar3/graphics/radiotoolbutton.py
+++ b/src/sugar3/graphics/radiotoolbutton.py
@@ -42,6 +42,7 @@ class RadioToolButton(Gtk.RadioToolButton):
GObject.GObject.__init__(self, **kwargs)
self._palette_invoker.attach_tool(self)
+ self._hide_tooltip_on_click = True
if icon_name:
self.set_icon_name(icon_name)
@@ -143,3 +144,18 @@ class RadioToolButton(Gtk.RadioToolButton):
cr.paint()
Gtk.RadioToolButton.do_draw(self, cr)
+
+ def get_hide_tooltip_on_click(self):
+ return self._hide_tooltip_on_click
+
+ def set_hide_tooltip_on_click(self, hide_tooltip_on_click):
+ if self._hide_tooltip_on_click != hide_tooltip_on_click:
+ self._hide_tooltip_on_click = hide_tooltip_on_click
+
+ hide_tooltip_on_click = GObject.property(
+ type=bool, default=True, getter=get_hide_tooltip_on_click,
+ setter=set_hide_tooltip_on_click)
+
+ def do_clicked(self):
+ if self._hide_tooltip_on_click and self.palette:
+ self.palette.popdown(True)