Add Symbol view #73
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "marquiskurt/adwaita-swift:main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Steps
Purpose
Describe the problem or feature.
I needed a way to display symbolic icons that I've added to my app without trying to determine where that symbolic icon lives. While I can use a
Pictureto display an arbitrary image from disk, I need to know the URL beforehand, and the location for icons seems to be a bit abstracted away.If there is a related issue, add the link.
No issue filed for this, I figured I'd just make the pull request after some sleuthing on my end.
Approach
Describe how this pull request solves the problem or adds the feature.
After browsing through the GTK documentation and libadwaita source code, I came across the
Imagetype, which did exactly what I needed. I updated the generator to generate this type, excludingfile,paintable,icon-name, andgiconand made a typealiased version calledSymbolso that folks would be less confused between what anImageand aPicturewas.Symbolcan be initialized by providing the icon in question:I've also updated the demo page to include this with some default icons. I would've loved to also include a custom one for completeness sake, but none existed for this.
Effectively, this behaves like a SwiftUI
Imagewith an SF Symbol instead of data.Thank you very much for this great addition :D