GNOME Bugzilla – Bug 623116
AnjutaTabber tabs don't look like "real" tabs
Last modified: 2020-11-06 20:22:06 UTC
Here are what seem to be regressions from using AnjutaTabber. I guess they are specific to my gtk engine (I'm using murrine) and/or theme (MurrinaVerdeOlivo) * Current tab isn't highlighted properly (only the thin border barely changes its color, while the full tab should change from beige to gray. This is especially annoying because there is a border below both active and inactive tabs. * padding for tab contents looks incorrect to me (at least for the message tabs icon and close button)
Created attachment 164875 [details] screenshot for message tabs guess which one is the active ;-)
First, cool to see that it works with RTL-language ;) The tabber uses the same drawing functions used by gtknotebook (gtk_paint_extension) and it draws it in GTK_STATE_NORMAL for normal tabs and GTK_STATE_ACTIVE for the active tab. I don't know how the murrine engine works exactly. Probably it does some special casing for GtkNotebook which doesn't work here. You can play around in anjuta_tabber_expose_event() if you like to see if you can improve things. Don't know if I will have time to take a deeper look, have to check how easy I can install such a theme.
(In reply to comment #2) > First, cool to see that it works with RTL-language ;) That reminds me of something I didn't mention : the tabs seem in the wrong order (for symbols it's search, global, local) but since they fill the entire space they aren't very annoying. Another difference is the little space between tabs. (Yes, this isn't RTL related, but annoying nevertheless) > The tabber uses the same drawing functions used by gtknotebook > (gtk_paint_extension) and it draws it in GTK_STATE_NORMAL for normal tabs and > GTK_STATE_ACTIVE for the active tab. > > I don't know how the murrine engine works exactly. Probably it does some > special casing for GtkNotebook which doesn't work here. You can play around in > anjuta_tabber_expose_event() if you like to see if you can improve things. I'll look at it if I find time. I've looked at all the themes I have installed (murrine themes + the default raleigh) and I see different results : some seem to work ok, some themes have a different text color for active tabs but the tabber uses the active color even for inactive tabs, etc. So I guess the problem isn't with the engine as different themes have different problems. > Don't know if I will have time to take a deeper look, have to check how easy I > can install such a theme. gtk2-engine-murrine and murrine-themes have been in the debian repositories for a long time, so it shouldn't be difficult.
I am using ambiance theme and have the same bug. Normal notebook tabs work correctly and I can see 'highlighted' tabs white. While AnjutaTabber tabs don't look like those. At the same time, I notice that gdl tabs don't even 'highlight' the current tab (hence indistinguishable from other unselected tabs). All, three tabs look different as a result.
OK, there are basically three things wrong: 1) The is a 1px gap between the tabs. This is a miscalculation in the anjuta-tabber expose code - should be easy to fix. 2) The code doesn't handle RTL languages correctly. Shouldn't be that difficult either, needs special casing in two or three places. 3) Theming seems to be incorrect (so I haven't tested it) for some themes. This might need some adjustments in the GtkStyle used. I don't know much about the theming so that's the most difficult for me. Btw, gdl uses a real GtkNotebook (when it is set to notebook-style tabs), so this is unlikely a bug in gdl. If you mean the buttons style which is basically a GtkToggleButton, things could be different.
Created attachment 165346 [details] [review] AnjutaTabber: fix horizontal padding of tab contents The padding was previously used as spacing between tabs (vertical padding is still not right)
Created attachment 165347 [details] [review] AnjutaTabber: correctly order tabs in RTL locales
Review of attachment 165347 [details] [review]: Thanks! ::: libanjuta/anjuta-tabber.c @@ +187,3 @@ GList* child; + gint x; + if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) I know that this looks like nit-picking, but I would prefer to have switch (gtk_widget_get_direction (widget) { case LTR: ... case RTL: } @@ +223,3 @@ child_alloc.height = MAX(child_req.height, allocation->height); + + if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR) same here
Review of attachment 165346 [details] [review]: Looks good! What's wrong with the vertical padding btw?
Review of attachment 165346 [details] [review]: Commited: http://git.gnome.org/browse/anjuta/commit/?id=f2e6c13ada6d6b2fcc9dbfbd2b02a467140a423d
Review of attachment 165347 [details] [review]: Commited with mentioned changes: http://git.gnome.org/browse/anjuta/commit/?id=842fceebc9a0a581deb92c76aabab41085241964
(In reply to comment #5) > > Btw, gdl uses a real GtkNotebook (when it is set to notebook-style tabs), so > this is unlikely a bug in gdl. If you mean the buttons style which is basically > a GtkToggleButton, things could be different. Yes, indeed. They were gdl button styles, not tabs. Somehow the theming is broken for the buttons.
They look nearly exactly like the notebook tabs now - I hope that is ok. Testing with other themes is appreciated...
I have to admit it's much better now, though it's nowhere like real tabs ... in RTL locales :-) (the tabs are arbitrarily misplaced) when running with with LANG=C, all I notice (apart from the wrong color) is that there is still not enough padding around tab content (the icon/close button is too close to the border), and the border is drawn twice between inactive tabs (in gtknotebook it's only drawn once). Other than that, it seems very good. Well done :-) As for the wrong color problem, I think I understand it now: some themes use a different color for an active tab by special casing on GtkNotebook. So I guess we cannot do much about them :-(
Thanks for looking into it. Would be nice if you have a look at RTL stuff because I cannot test it here and it might indeed be broken. Should be obvious to fix. About the padding: It looks ok here but that's the default theme. But you are right with the border issue, will have a look at that.
Created attachment 183305 [details] [review] work in progress...
Created attachment 183822 [details] [review] libanjuta: fix AnjutaTabber for RTL locales
Created attachment 183823 [details] [review] libanjuta: allocate the same height to all tabs in AnjutaTabber
Thanks for the patches. How are thingks looking like in general for you? I think I am still some pixels off sometimes but I didn't have time to investigate that further.
I vastly improved this: http://git.gnome.org/browse/anjuta/commit/?id=05c2a5c0064869e01010e1c6b288af0d120b78ad However, that might break with themes setting totally different values for tab-overlap and tab-curvature (the latter being the primary problem). Maybe someone can check if such themes exist.
At least the default gtk theme (Raleigh) doesn't work like adwaita. The tabs don't normally overlap but anjuta-tabber tabs do. What's the problem exactly with getting tab-overlap and tab-curvature? Can't it somehow be fixed in gtk?
The problem is that gtk+ doesn't give us the values for tab-overlap and tab-curvature that it actually uses in the theming engine (because those are defined in the theming engine somewhere). We only get the default values from GtkNotebook but those are overwritten by the theme later.
But the theming engine doesn't overwrite our own values that we fake because the theming engine special cases GtkNotebook, so we pretent to be one even as we aren't.
bugzilla.gnome.org is being replaced by gitlab.gnome.org. We are closing all old bug reports in Bugzilla which have not seen updates for many years. If you can still reproduce this issue in a currently supported version of GNOME (currently that would be 3.38), then please feel free to report it at https://gitlab.gnome.org/GNOME/anjuta/-/issues/ Thank you for reporting this issue and we are sorry it could not be fixed.