← easystroke

use tooltip colors for popups

35aede2c6a4a01f4d81e56037759cfbcbaf934d7 · Thomas Jaeger · May 4, 2010 11:12

Turns out what you need to do is set the window name to "gtk-window".

http://sourceforge.net/apps/trac/easystroke/ticket/46

+4 −2 · 1 file changed

  • stats.cc +4 −2
diff --git a/stats.cc b/stats.cc
index c4f9d51..e83517d 100644
--- a/stats.cc
+++ b/stats.cc
@@ -62,9 +62,10 @@ public:
 		int w,h;
 		if (s) {
 			icon.reset(new Gtk::Window(Gtk::WINDOW_POPUP));
+			icon->set_type_hint(Gdk::WINDOW_TYPE_HINT_TOOLTIP);
+			icon->set_name("gtk-tooltip");
 			WIDGET(Gtk::Image, image, s->draw(STROKE_SIZE));
 			icon->set_accept_focus(false);
-			icon->modify_bg(Gtk::STATE_NORMAL, Gdk::Color("LemonChiffon"));
 			icon->add(image);
 			image.show();
 			icon->get_size(w,h);
@@ -74,10 +75,11 @@ public:
 
 		if (t != "") {
 			text.reset(new Gtk::Window(Gtk::WINDOW_POPUP));
+			text->set_type_hint(Gdk::WINDOW_TYPE_HINT_TOOLTIP);
+			text->set_name("gtk-tooltip");
 			text->set_accept_focus(false);
 			text->set_border_width(2);
 			WIDGET(Gtk::Label, label, t);
-			text->modify_bg(Gtk::STATE_NORMAL, Gdk::Color("LemonChiffon"));
 			text->add(label);
 			label.show();
 			text->get_size(w,h);