Community
Participate
Working Groups
All tabs background is white instead of gray.
The fix being explored involved changing the CSS architecture in TabFolder.java however, this class uses the Control.java css architecture so implementing it is deeper than expected. Exploring a different fix to see if its just a GTK3->GTK4 internal change in TabFolder that caused the CSS background to be incorrect.
This background issue is most likely not related to tab folder directly, and more to do with how SWT/GTK deals with system themes. For example, in GTK3 changing the theme to dark mode leaves the background of the tabs as their previous non-dark mode colors. However, in GTK4, the backgrounds change to dark mode colors. This to me seems like a better result, as dark mode support in SWT is not the best in GTK3.
To add to this, using the Adwaita theme with "Dark Variant" turned on does result in the correct result in GTK3, but not if using the Adwaita-dark theme.
I was finally able to come up with a small reproducer for this bug. This bug occurs when a Composite is placed inside of a TabFolder, but not on Composites alone without first being set as a TabItem's control. Setting the background mode "background color" checkbox sets the background blue, then unchecking the box returns the background back to the correct color. This is because setBackgroundColor is called with "null" which sets it back to the default SWT background color. My main idea: Composite is inheriting the background color of its parent as the GtkNotebook "stack" node has its background-color property set as white (255 for R,G,B). I'll be checking to see what can be done about this.
New Gerrit change created: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/188699
Created a patch to fix this in GTK4. More details in the commit message, but summary is that Composite was inheriting the background-color from the "stack" node of GtkNotebook. Setting the stack background-color upon creation solves the issue and allows for normal background changes.
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/188699 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=e6d75ddf66cc0bc240419f28e49f368e0fccc70a
Verified in 4.23 M1 I build (I20220106-0000).