Bug 577370 - [GTK4] CSS not being applied correctly to widgets
Summary: [GTK4] CSS not being applied correctly to widgets
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.22   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 540385 567138 567215 574977
  Show dependency tree
 
Reported: 2021-11-19 16:18 EST by Joel Majano CLA
Modified: 2021-12-01 16:10 EST (History)
0 users

See Also:


Attachments
Snippet to reproduce ToolBar background Bug (Background should be red) (859 bytes, application/octet-stream)
2021-11-19 16:18 EST, Joel Majano CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Majano CLA 2021-11-19 16:18:19 EST
Created attachment 287551 [details]
Snippet to reproduce ToolBar background Bug (Background should be red)

On GTK4, CSS Styles are not being applied correctly. A couple examples so far are in the ToolBar snippet included and in ControlExample, where the background of certain elements are white instead of gray (in GTK3).

In the included snippet, the toolbar background should be red (which it is in GTK3) but it is gray instead.

There is also a css warning which can be resolved by changing the "String css =..." line in ToolBar.java:636 and adding <+ ";}"> to the end.
Comment 1 Joel Majano CLA 2021-11-30 12:28:40 EST
After seeing Alexandr Miloslavskiy's patch for Bug 570502, I was interested in seeing what effects that would have on GTK4. I reverted back to the commit before that bug was fixed to test it out. I tried the original snippet that was included to reproduce that bug, and in GTK4 (Wayland) the snippet is unable to launch as there are gtk_style_context_add_provider and gtk_css_provider_load_from_data errors. 

Now switching to master, the snippet launches with no errors. However, even though the combo appears to be looking like its supposed to, the drop down menu is incorrect as it appears white/gray, when its supposed to be the same color as the background (dark grey).

As pointed out by Alex in the comments of that patch, it seems that a lot of these CSS issues can start being fixed by implementing something like Alexandr did here (https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/176058) and then figuring out why certain elements are still not working.