summaryrefslogtreecommitdiff
path: root/libs/gtkmm2ext/utils.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-06-11 21:21:10 +0000
committerCarl Hetherington <carl@carlh.net>2012-06-11 21:21:10 +0000
commitf4ed14a83b3dfc0af9b92db5f73f3389c7773a04 (patch)
tree567975a635ed74a761df1452054cf4d41caad286 /libs/gtkmm2ext/utils.cc
parent366b7ac36baecba48e59e9d96f8b2fd27633957b (diff)
Factor out 'persistent' tooltip code from the panner
interface and use it for processor box sliders (#4461). git-svn-id: svn://localhost/ardour2/branches/3.0@12661 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/gtkmm2ext/utils.cc')
-rw-r--r--libs/gtkmm2ext/utils.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/gtkmm2ext/utils.cc b/libs/gtkmm2ext/utils.cc
index 63d7655331..11c5b90722 100644
--- a/libs/gtkmm2ext/utils.cc
+++ b/libs/gtkmm2ext/utils.cc
@@ -30,6 +30,7 @@
#include <gtkmm/paned.h>
#include <gtkmm/label.h>
#include <gtkmm/comboboxtext.h>
+#include <gtkmm/tooltip.h>
#include "i18n.h"
@@ -631,3 +632,21 @@ Gtkmm2ext::left_aligned_label (string const & t)
l->set_alignment (0, 0.5);
return l;
}
+
+static bool
+make_null_tooltip (int, int, bool, const Glib::RefPtr<Gtk::Tooltip>& t)
+{
+ t->set_tip_area (Gdk::Rectangle (0, 0, 0, 0));
+ return true;
+}
+
+/** Hackily arrange for the provided widget to have no tooltip,
+ * and also to stop any other widget from providing one while
+ * the mouse is over w.
+ */
+void
+Gtkmm2ext::set_no_tooltip_whatsoever (Gtk::Widget& w)
+{
+ w.property_has_tooltip() = true;
+ w.signal_query_tooltip().connect (sigc::ptr_fun (make_null_tooltip));
+}