GNOME Bugzilla – Bug 711233
no way to style :hover state for tabs
Last modified: 2014-01-14 19:35:44 UTC
I'd like to be able to make tabs prelight on mouse hover. Additionally I would prefer :active state to mimic the web and not refer to the selected tab, but the "pushed" state.
Created attachment 266021 [details] [review] patch Here is a patch. It is still not 100% correct since in some cases the prelighted state is not cleared I tested putting .notebook tab:hover { background-color: red; } in adwaita this is how it looks https://people.gnome.org/~pborelli/tab_prelight.webm
Created attachment 266237 [details] [review] patch
Created attachment 266246 [details] [review] patch (fix indentation in last patch)
(In reply to comment #3) > Created an attachment (id=266246) [details] [review] > patch > Looks good, but I think it misses code for updating pelight when tabs get added/removed, doesn't it? In particular, i'm worried about priv->prelight_tab pointing to a tab that doesn't exist anymore because it was deleted.
Created attachment 266292 [details] [review] patch This is the same patch, but making sure to clear the pointer when a the tab is removed, so it should be safe. I tried a more complex approach that tries to handle the case where a page is insterted or removed and so the tab under the pointer changes, but it becomes quite ugly, sine we need to keep around the device to query the cursor position etc. I will attach it for reference, but I would prefer to keep it simple and see if anyone complains about the corner cases.
Created attachment 266293 [details] [review] patch this is the alternative more complex, but more complete patch. It needs more work to manage the tab insert case (probably forcing a recalculation of the tabs allocation or something like that to make get_tab_at_pos work). As stated above I'd rather do not go down this road since it adds another load of tricky code to gtknotebook (e.g. in theory the device could be unplugged etc)
Comment on attachment 266292 [details] [review] patch Ok, the patch is now in. Now we need to fix the themes to take advantage of it
I have cloned the bug for the other issue reported by Jimmac. I am closing this one