Skip to content

Conversation

Oppzippy
Copy link

No description provided.

#[cfg(target_os = "linux")]
let icon = icon::from_name("pan-down-symbolic").size(16).handle();
#[cfg(not(target_os = "linux"))]
let icon = icon::from_svg_bytes(include_bytes!("../../../res/icons/pan-down-symbolic.svg"))
Copy link
Member

Choose a reason for hiding this comment

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

This should be a static global variable, and shared between other widgets that are also using this icon. The multi dropdown and table widgets also use this icon.

Copy link
Author

Choose a reason for hiding this comment

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

So something like this? A function is used to clone it for convenience, since references to an icon::Handle aren't useful. 31fa09a...48ffffd

Or would it be preferable to wrap the icon in a struct that passes through function calls to the inner icon::Named on Linux, but those functions do nothing on Windows since they're not relevant for from_svg_bytes icons? That way the caller doesn't need to care about whether or not the icon is bundled. 31fa09a...8944f59

Copy link
Member

Choose a reason for hiding this comment

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

I have some ideas. I'll look into this soon

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