Any plans to support compose resources and passing...
# jewel
m
Any plans to support compose resources and passing resources directly without creating IconKey?
s
You can use the standard Compose for Desktop APIs for interacting with Compose Resources — IconKey is not going to go away as a way to accessing icons in Jewel as it's a necessary abstraction over IJP's icon loading to make it portable between standalone and bridge modes.
In fact as of 0.25.0, Jewel uses Compose Resources under the hood when loading from IconKeys
m
What about having function overloading? Each component that accepts an IconKey can accept a painter, bitmap...
s
You can use the existing Compose for Desktop APIs for that
Unless you want to also use the PainterHints API
but that is not a scenario we're considering for now
since several PainterHints have no meaning/can't work in scenarios where you pass in a painter/imagebitmap/... since they need access to a file path, or the SVG code
Icon(painter, contentDescription) would not be any different from using Image(painter, contentDescription) at that point
The Icon API is meant to be used for SVG icons, loaded from resources
It doesn't really mean much in other scenarios
Hope I have explained the reasoning well enough 🙂
thank you color 1
c
Each component that accepts an IconKey can accept a painter, bitmap...
Are there specific UI components that you are NOT seeing a slot based API that would accommodate using different Icon composables?
m
Thanks for the explanation, totally makes sense for Icon
👍 1
But there are other components such as SelectableIconActionButton that only accepts IconKey
s
ah, yeah, that is a good point. Could you file an issue requesting a slot-based version of the impacted components?
I can't promise we'll get to it right away but we should eventually
m
Ok cool, maybe I can even create a PR for that.
s
That'd be even better! :) we'd appreciate the contribution
😄 1