-
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
// TODO The color dialog isn't opened a non-modal window. However, the | ||
// "same" API is used for e.g. the Font Dialog, where everything works. | ||
// So this looks like a bug within GTK... | ||
// Error: | ||
// g_object_new_valist: invalid object type 'SwtFixed' for value type 'GtkWindow' | ||
// GtkDialog mapped without a transient parent. This is discouraged. | ||
GTK4.gtk_color_dialog_set_modal(handle, true); | ||
GTK4.gtk_color_dialog_set_title(handle, buffer); |
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.
The "SwtFixed" is obviously something that comes from SWT, but I don't really understand how it works or why it's needed. And given that this doesn't cause issues for the Font Dialog, where I use same shell, I fail to see why it works in one but not the other...
// 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. :/
7a4a404
to
6cd388f
Compare
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.
6cd388f
to
c5f57d4
Compare
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.