From 63b8e87b1a99a854e9adbb1579b1e05244d2dc46 Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Fri, 15 Feb 2013 12:58:58 +0000 Subject: ToggleToolbutton: do hide the tooltip when clicked or touched This is the same behaviour as for the RadioToolButton and the ToolButton. See 5a1b380dd6099d7455d67e00718388fa79b57e01 where we did the same for the RadioToolbutton. Updated the toolbuttons.py test to be able to test that code path. Signed-off-by: Simon Schampijer Acked-by: Manuel QuiƱones --- diff --git a/src/sugar3/graphics/toggletoolbutton.py b/src/sugar3/graphics/toggletoolbutton.py index dad39a4..0c4e592 100644 --- a/src/sugar3/graphics/toggletoolbutton.py +++ b/src/sugar3/graphics/toggletoolbutton.py @@ -141,4 +141,8 @@ class ToggleToolButton(Gtk.ToggleToolButton): return False + def do_clicked(self): + if self.palette: + self.palette.popdown(True) + palette = property(get_palette, set_palette) diff --git a/tests/graphics/toolbuttons.py b/tests/graphics/toolbuttons.py index 3344cba..e189406 100644 --- a/tests/graphics/toolbuttons.py +++ b/tests/graphics/toolbuttons.py @@ -37,6 +37,7 @@ toolbar_box.toolbar.insert(color_button, -1) color_button.show() favorite_button = ToggleToolButton('emblem-favorite') +favorite_button.set_tooltip('Favorite') toolbar_box.toolbar.insert(favorite_button, -1) favorite_button.show() -- cgit v0.9.1