[PATCH] fix permanent highlight of tab close buttons

Juho Snellman <[email protected]>
Newsgroups gmane.comp.web.galeon.devel
Message-ID <[email protected]>
Attached patch fixes the annoying highlight of the close buttons
for inactive tabs. It accomplishes this by setting the state of
the button to GTK_STATE_NORMAL whenever it's (IMHO wrongly) set
to GTK_STATE_ACTIVE by gtknotebook. (I'm pretty sure that it's
impossible for the buttons to become ACTIVE by any other means.)

-- 
Juho Snellman
galeon-close-button-highlight-2003-04-03.patch (text/plain, 1.1 KB)
Index: utils/gul-notebook.c
===================================================================
RCS file: /cvsroot/galeon/galeon/utils/gul-notebook.c,v
retrieving revision 1.22
diff -u -r1.22 gul-notebook.c
--- utils/gul-notebook.c	17 Feb 2003 14:13:59 -0000	1.22
+++ utils/gul-notebook.c	2 Apr 2003 21:19:48 -0000
@@ -645,6 +645,17 @@
 	gul_notebook_remove_page (notebook, child);
 }
 
+static
+gboolean
+galeon_tab_close_button_expose_cb (GtkWidget *widget)
+{
+    if (GTK_WIDGET_STATE(widget) == GTK_STATE_ACTIVE) {
+        gtk_widget_set_state(widget, GTK_STATE_NORMAL);
+    }
+    
+    return FALSE;
+}
+
 static GtkWidget *
 tab_build_label (GulNotebook *nb, GtkWidget *child)
 {
@@ -694,6 +705,9 @@
 
 	g_signal_connect (G_OBJECT (close_button), "clicked",
                           G_CALLBACK (galeon_tab_close_button_clicked_cb),
+                          child);
+	g_signal_connect (G_OBJECT (close_button), "expose_event",
+                          G_CALLBACK (galeon_tab_close_button_expose_cb),
                           child);
 		
 	gtk_widget_show (hbox);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.