Skip to content

SettingsPopover: Gtk4 preparation#885

Closed
jeremypw wants to merge 3 commits into
masterfrom
jeremypw/settingspopover/gtk4prep
Closed

SettingsPopover: Gtk4 preparation#885
jeremypw wants to merge 3 commits into
masterfrom
jeremypw/settingspopover/gtk4prep

Conversation

@jeremypw

Copy link
Copy Markdown
Collaborator

Theme button related code is changed to look more like the Gtk4 equivalent in the trial port (where it is necessary to use CheckButton)

private static void update_active_colorbutton (Gtk.RadioButton default_button, string theme) {
SearchFunc<Gtk.RadioButton,string> find_colorbutton = (b, t) => strcmp (b.action_target.get_string (), t);
unowned var node = default_button.get_group ().search (theme, find_colorbutton);
private void update_active_colorbutton (Gtk.RadioButton default_button, string theme) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems incorrect to me. This should be automatically handled by a stateful action

Gtk.StyleContext.add_provider_for_screen (
Gdk.Screen.get_default (),
css_provider,
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION + 1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have you changed the style provider priority here?


button.get_style_context ().add_class (Granite.STYLE_CLASS_COLOR_BUTTON);
button.set_data<string> ("theme", theme);
button.get_style_context ().add_class ("color-button");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for not using the Granite constant here?

};

button.get_style_context ().add_class (Granite.STYLE_CLASS_COLOR_BUTTON);
button.set_data<string> ("theme", theme);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem right. This is what action_target is for

@jeremypw

jeremypw commented Aug 3, 2025

Copy link
Copy Markdown
Collaborator Author

Yes, it felt hacky when I did it during the trial port - I made a note there that I did it that way to reduce the porting diff. But as it is being done separately here we can do the job properly (which I see you have in separate PR - thanks). I'll close this one in favour of yours and do another cleanup PR later.

@jeremypw jeremypw closed this Aug 3, 2025
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