GNOME Bugzilla – Bug 93389
GtkEventBox in an inactive GtkNotebook tab doesn't follow style
Last modified: 2011-02-04 16:11:56 UTC
Inactive notebook tab with an eventbox in it doesn't follow the style. It looks like the eventbox remains using the default background color instead of the slightly darker color in inactive tabs.
Small standalone compileable test case would be useful here.
Created attachment 11193 [details] testgtknotebook.c
Created attachment 11566 [details] [review] Patch
I think the problem is that the notebook doesn't set the widget state for the tab widgets.
Hmm, yeah. There is no precendent for widgets setting the state of children rather than their own state, so I'm not _exactly_ sure how it should work in detail. But it seems plausible. I think the code needs to also set the state in gtk_notebook_insert_page_menu() and gtk_notebook_set_tab_label or added labels won't necessarily get the right state. You probably also should set the state back to GTK_STATE_NORMAL in gtk_notebook_remove_tab_label()
I just wanted to add that the patch applied to gtk-2-0 seems to fix the problems we saw in GIMP-1.3 with labels of GimpDockBooks drawn in a wrong state. However, as Owen said, the patch is probably incomplete.
Created attachment 11597 [details] [review] New attempt (takes care of Owen's comments and gtk_notebookr_child_reordered())
I just tried the patch and it seems to work for the default theme. However, when using Crux it's still as broken as ever. Is this only a problem in the theme, or did you overlook something?
I don't have Crux installed, so I don't know. Could you try putting an eventbox inside a button and see if it changes color when the button is pressed? Please try both with the default theme and with crux, and make sure you restart the test program after changing theme (instant apply notwithstanding).
With Crux the color of the eventbox remains flat light gray. It is clearly visible whether the button is pressed or not. With the default theme I don't notice the eventbox.
In that case, it's probably a bug in Crux. Wrt. the patch, I don't think the call to gtk_notebook_update_tab_states() in gtk_notebook_child_reordered() is necessary. Somehow I must have thought that the activeness of the tabs could change when that function was called, but I don't think it can.
See also bug 98207
*** Bug 103206 has been marked as a duplicate of this bug. ***
Thu Jan 30 16:54:29 2003 Owen Taylor <otaylor@redhat.com> * gtk/gtknotebook.c: Patch from Soeren Sandmann to update the states of the tab label child widgets to match the state of the tabs. (#93389, Reported by Tommi Komulainen)