-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GTK4] Migrate deprecated ColorChooser to ColorDialog #1629
base: master
Are you sure you want to change the base?
Conversation
bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ColorDialog.java
Outdated
Show resolved
Hide resolved
// TODO The ColorDialog API doesn't support setting a custom palette | ||
// See https://gitlab.gnome.org/GNOME/gtk/-/issues/5936 | ||
// > The new GtkColorDialog api doesn't have this feature atm. We might | ||
// > want to bring it back, but judging from application use of color | ||
// > choosers, setting custom palettes is not very popular. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is probably really bad. But as mentioned in the linked issue, as well as the documentation, there is simply no way to customize the palette.
Meaning this is probably something that would first have to be implemented, but I don't think my GTK knowledge is sufficient to do so. :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should merge this one as there is not much to be done from SWT side.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me. I fear that contributing the palette customization directly to GTK is beyond my capabilities, so the current state has to suffice for now.
7a4a404
to
6cd388f
Compare
6cd388f
to
c5f57d4
Compare
Would you please rebase on master and remove the draft if you agree that it's time to get this one in. |
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.
c5f57d4
to
f041bb4
Compare
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. |
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. |
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. |
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.