Skip to content

Conversation

@ptziegler
Copy link
Contributor

The Color Chooser has been moved to the GTK3 class and all references inside the GTK4 blocks have been updated to use the new API.

Note that the GTK4 API doesn't provide the means to set a custom palette, meaning that the colors specified with setRGBS(RGB[]) are effectively ignored.

@ptziegler
Copy link
Contributor Author

GTK3:

ColorDialog_gtk3

GTK4:

ColorDialog_gtk4

@github-actions
Copy link
Contributor

github-actions bot commented Nov 28, 2024

Test Results

   502 files  + 1     502 suites  +1   10m 36s ⏱️ - 3m 47s
 4 334 tests +37   4 320 ✅ +35   14 💤 +3  0 ❌  - 1 
16 575 runs  +37  16 466 ✅ +35  109 💤 +3  0 ❌  - 1 

Results for commit d9df766. ± Comparison against base commit b4fabe5.

♻️ This comment has been updated with latest results.

@ptziegler ptziegler marked this pull request as draft December 8, 2024 10:06
@akurtakov
Copy link
Member

Would you please rebase on master and remove the draft if you agree that it's time to get this one in.

@ptziegler ptziegler marked this pull request as ready for review January 30, 2025 19:24
@ptziegler
Copy link
Contributor Author

Would you please rebase on master and remove the draft if you agree that it's time to get this one in.

I only wanted to revisit the issue with the modal dialog but that has now been fixed. I don't see any (additional) warnings when trying out the snippets so I think this is done for now.

@akurtakov
Copy link
Member

akurtakov commented Jan 30, 2025

There is one fundamental problem - the gtk_color_dialog calls are guarded with if( GTK4) blocks but they are introduced in gtk 4.10 so these symbols will simply fail to load (hard crash) if swt is run on gtk 4.0-4.8.
I believe the ColorChooser API should stay in GTK class and be used till gtk 4.8. The ColorDialog API should be guarded using if (GTK.GTK_VERSION >= OS.VERSION(4, 10, 0)) blocks.

@akurtakov
Copy link
Member

Now I realize I missed the same problem in #1583 so we will have to redo it too.

@ptziegler
Copy link
Contributor Author

Now I realize I missed the same problem in #1583 so we will have to redo it too.

I was just about to ask about the Font/Dialog chooser. I can have a look at it over the weekend.

@ptziegler
Copy link
Contributor Author

Now I realize I missed the same problem in #1583 so we will have to redo it too.

#1793

@ptziegler
Copy link
Contributor Author

I've also updated this PR to guard the ColorDialog API behind a "GTK 4.10" check. This should avoid the crash with older GTK4 versions.

The Color Chooser has been moved to the GTK3 class and all references
inside the GTK4 blocks have been updated to use the new API.

Note that the GTK4 API doesn't provide the means to set a custom
palette, meaning that the colors specified with setRGBS(RGB[]) are
effectively ignored.
@akurtakov
Copy link
Member

This one is good to go.

@akurtakov akurtakov merged commit b0692ca into eclipse-platform:master Feb 10, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants