fix(dropdown): missing icon on windows

This commit is contained in:
Kyle Scheuing 2025-09-11 20:28:56 -04:00
parent e568122083
commit 5fddddf296
No known key found for this signature in database
GPG key ID: 72CE2DDCDA12B906
2 changed files with 10 additions and 1 deletions

View file

@ -0,0 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M13 6L8 11L3 6H13Z" fill="#232323"/>
</svg>

After

Width:  |  Height:  |  Size: 149 B

View file

@ -373,8 +373,14 @@ pub struct State {
impl State { impl State {
/// Creates a new [`State`] for a [`Dropdown`]. /// Creates a new [`State`] for a [`Dropdown`].
pub fn new() -> Self { pub fn new() -> Self {
#[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"))
.symbolic(true);
Self { Self {
icon: match icon::from_name("pan-down-symbolic").size(16).handle().data { icon: match icon.data {
icon::Data::Name(named) => named icon::Data::Name(named) => named
.path() .path()
.filter(|path| path.extension().is_some_and(|ext| ext == OsStr::new("svg"))) .filter(|path| path.extension().is_some_and(|ext| ext == OsStr::new("svg")))