From 5a1b380dd6099d7455d67e00718388fa79b57e01 Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Tue, 27 Nov 2012 13:41:55 +0000 Subject: RadioToolButton: hide tooltip on click, SL #4268 This is the same behaviour as with the ToolButton. Signed-off-by: Simon Schampijer Acked-by: Manuel QuiƱones --- 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) -- cgit v0.9.1