After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 711233 - no way to style :hover state for tabs
no way to style :hover state for tabs
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkNotebook
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 722203
 
 
Reported: 2013-10-31 21:26 UTC by Jakub Steiner
Modified: 2014-01-14 19:35 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (4.56 KB, patch)
2014-01-11 18:22 UTC, Paolo Borelli
none Details | Review
patch (5.16 KB, patch)
2014-01-14 09:13 UTC, Paolo Borelli
none Details | Review
patch (5.17 KB, patch)
2014-01-14 11:46 UTC, Paolo Borelli
needs-work Details | Review
patch (5.39 KB, patch)
2014-01-14 19:08 UTC, Paolo Borelli
committed Details | Review
patch (6.41 KB, patch)
2014-01-14 19:12 UTC, Paolo Borelli
needs-work Details | Review

Description Jakub Steiner 2013-10-31 21:26:41 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.
Comment 1 Paolo Borelli 2014-01-11 18:22:57 UTC
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
Comment 2 Paolo Borelli 2014-01-14 09:13:40 UTC
Created attachment 266237 [details] [review]
patch
Comment 3 Paolo Borelli 2014-01-14 11:46:02 UTC
Created attachment 266246 [details] [review]
patch

(fix indentation in last patch)
Comment 4 Benjamin Otte (Company) 2014-01-14 13:56:10 UTC
(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.
Comment 5 Paolo Borelli 2014-01-14 19:08:52 UTC
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.
Comment 6 Paolo Borelli 2014-01-14 19:12:03 UTC
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 7 Paolo Borelli 2014-01-14 19:32:52 UTC
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
Comment 8 Paolo Borelli 2014-01-14 19:35:44 UTC
I have cloned the bug for the other issue reported by Jimmac. I am closing this one