gtk4-prep: stop using GtkButton image API (#15920)#21541
Open
Arecsu wants to merge 1 commit into
Open
Conversation
Replace: - `gtk_button_set_image()` - `gtk_button_set_always_show_image()` - `gtk_button_set_image_position()` - `gtk_button_get_image()` - `gtk_button_get_image_position()` with manual GtkBox packing for the Lua button widget. These are all removed in GTK4. Guard against `gtk_button_set_label()` replacing our box (GTK3 creates a new label child and destroys the custom child), show newly replaced images, and force relayout after orientation changes.
GtkButton image API (#15920)
Member
|
@Arecsu should the actual widget code such as dt_lua_button_get_widget_in_box, be in gui/dtgtk.c wthout the lua in the function name, and then just called from lua/wiodget/button.c? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace:
gtk_button_set_image()gtk_button_set_always_show_image()gtk_button_set_image_position()gtk_button_get_image()gtk_button_get_image_position()with manual GtkBox packing for the Lua button widget. These are all removed in GTK4.
Guard against
gtk_button_set_label()replacing our box (GTK3 creates a new label child and destroys the custom child), show newly replaced images, and force relayout after orientation changes.Also refactored the code to clean things up.
I used this lua script to test it, no errors. Even solved some pre existent assertion errors:
Related: #15920 #20433