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 623116 - AnjutaTabber tabs don't look like "real" tabs
AnjutaTabber tabs don't look like "real" tabs
Status: RESOLVED OBSOLETE
Product: anjuta
Classification: Applications
Component: libanjuta
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Naba Kumar
Anjuta maintainers
Depends on:
Blocks:
 
 
Reported: 2010-06-29 10:36 UTC by Abderrahim Kitouni
Modified: 2020-11-06 20:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot for message tabs (9.83 KB, image/png)
2010-06-29 10:40 UTC, Abderrahim Kitouni
  Details
AnjutaTabber: fix horizontal padding of tab contents (2.44 KB, patch)
2010-07-06 11:06 UTC, Abderrahim Kitouni
committed Details | Review
AnjutaTabber: correctly order tabs in RTL locales (1.77 KB, patch)
2010-07-06 11:10 UTC, Abderrahim Kitouni
committed Details | Review
work in progress... (8.00 KB, patch)
2011-03-13 21:40 UTC, Johannes Schmid
none Details | Review
libanjuta: fix AnjutaTabber for RTL locales (1.20 KB, patch)
2011-03-19 22:20 UTC, Abderrahim Kitouni
committed Details | Review
libanjuta: allocate the same height to all tabs in AnjutaTabber (1.32 KB, patch)
2011-03-19 22:21 UTC, Abderrahim Kitouni
committed Details | Review

Description Abderrahim Kitouni 2010-06-29 10:36:38 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)
Comment 1 Abderrahim Kitouni 2010-06-29 10:40:44 UTC
Created attachment 164875 [details]
screenshot for message tabs

guess which one is the active ;-)
Comment 2 Johannes Schmid 2010-06-29 12:17:44 UTC
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.
Comment 3 Abderrahim Kitouni 2010-06-29 14:15:28 UTC
(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.
Comment 4 Naba Kumar 2010-07-03 08:20:26 UTC
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.
Comment 5 Johannes Schmid 2010-07-03 09:32:03 UTC
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.
Comment 6 Abderrahim Kitouni 2010-07-06 11:06:49 UTC
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)
Comment 7 Abderrahim Kitouni 2010-07-06 11:10:02 UTC
Created attachment 165347 [details] [review]
AnjutaTabber: correctly order tabs in RTL locales
Comment 8 Johannes Schmid 2010-07-06 11:39:35 UTC
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
Comment 9 Johannes Schmid 2010-07-06 11:41:14 UTC
Review of attachment 165346 [details] [review]:

Looks good!

What's wrong with the vertical padding btw?
Comment 11 Johannes Schmid 2010-07-09 22:09:05 UTC
Review of attachment 165347 [details] [review]:

Commited with mentioned changes:
http://git.gnome.org/browse/anjuta/commit/?id=842fceebc9a0a581deb92c76aabab41085241964
Comment 12 Naba Kumar 2010-07-16 09:11:02 UTC
(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.
Comment 13 Johannes Schmid 2010-11-23 16:16:25 UTC
They look nearly exactly like the notebook tabs now - I hope that is ok. Testing with other themes is appreciated...
Comment 14 Abderrahim Kitouni 2010-11-24 17:19:26 UTC
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 :-(
Comment 15 Johannes Schmid 2010-11-24 17:30:30 UTC
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.
Comment 16 Johannes Schmid 2011-03-13 21:40:20 UTC
Created attachment 183305 [details] [review]
work in progress...
Comment 17 Abderrahim Kitouni 2011-03-19 22:20:28 UTC
Created attachment 183822 [details] [review]
libanjuta: fix AnjutaTabber for RTL locales
Comment 18 Abderrahim Kitouni 2011-03-19 22:21:18 UTC
Created attachment 183823 [details] [review]
libanjuta: allocate the same height to all tabs in AnjutaTabber
Comment 19 Johannes Schmid 2011-03-20 00:27:19 UTC
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.
Comment 20 Johannes Schmid 2012-02-12 15:39:51 UTC
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.
Comment 21 Abderrahim Kitouni 2012-02-18 18:30:29 UTC
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?
Comment 22 Johannes Schmid 2012-07-11 09:59:23 UTC
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.
Comment 23 Johannes Schmid 2012-07-11 10:00:41 UTC
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.
Comment 24 André Klapper 2020-11-06 20:22:06 UTC
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.