Skip to content

Conversation

@slowsage
Copy link
Contributor

For symbolic icons to work with ironbar's icon_theme, we need to adapt to GTK 4.20 changes.

Required more refactoring than intended to

  1. keep the Image vs Picture check localized
  2. handle both sync (Image) and async (Picture).

Also removed duplicate feature = "clipboard",.

Relevant:
https://docs.gtk.org/gtk4/migrating-3to4.html#adapt-to-gtkicontheme-api-changes
https://docs.gtk.org/gtk4/migrating-3to4.html#dont-use-gtk-icon-theme-in-your-css

Fixes: #1039

Given the scope, prolly makes sense for v0.19.

@slowsage slowsage marked this pull request as draft November 20, 2025 00:23
GTK 4.20 changed Picture widget behavior for symbolic IconPaintable.
https://docs.gtk.org/gtk4/migrating-3to4.html#adapt-to-gtkicontheme-api-changes
Uses Image widget for icon: prefix.

Fixes: JakeStanger#1039
@slowsage slowsage marked this pull request as ready for review November 20, 2025 02:31
Copy link
Owner

@JakeStanger JakeStanger left a comment

Choose a reason for hiding this comment

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

Code lgtm, thanks.

What impact this has on GTK versions prior to 4.20? I would assume nothing but I'd like to confirm that prior to merge.

Did the GTK4 port cause a regression in the behaviour in any way, or is this fixing the issue as it was in GTK3?

@slowsage
Copy link
Contributor Author

slowsage commented Nov 20, 2025

What impact this has on GTK versions prior to 4.20? I would assume nothing but I'd like to confirm that prior to merge.

My understanding it it should work on gtk 4 prior to 4.20 - simply avoided is_symbolic (carried over from 3.0) and get_icon_name (added in 4.0) - both got removed in 4.20.

Did the GTK4 port cause a regression in the behaviour in any way, or is this fixing the issue as it was in GTK3?
AFAIK, the issue was there in both versions:

  • GTK3 - ironbar should have used set_from_icon_name for symbolic icons - do not think it did.
  • Even if it did, it would not have respected icon_theme.
  • The proper icon_theme respecting solution is only possible in gtk4 AFAIK.

Edit: In gtk3, there was a css based gtk-icon-theme config so it may have been possible to inject icon_theme into that to set theme even on a per-module basis. But per this: GTK 4 always uses the current icon theme, with no way to change this.

@JakeStanger
Copy link
Owner

Thanks for clarifying. I'll give it a quick test to make sure, but otherwise sounds like targeting 0.19 is sensible.

@JakeStanger JakeStanger added Z:Changes Requested Pull request awaiting changes from author and removed Z:Changes Requested Pull request awaiting changes from author labels Dec 6, 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.

GTK symbolic icons are not themed

2 participants