cosmic/widget/icon/bundle.rs
1// Copyright 2025 System76 <info@system76.com>
2// SPDX-License-Identifier: MPL-2.0
3
4//! Embedded icons for platforms which do not support icon themes yet.
5
6/// Icon bundling is not enabled on unix platforms.
7#[cfg(all(unix, not(target_os = "macos")))]
8pub fn get(icon_name: &str) -> Option<super::Data> {
9 None
10}
11
12#[cfg(any(not(unix), target_os = "macos"))]
13/// Get a bundled icon on non-unix platforms.
14pub fn get(icon_name: &str) -> Option<super::Data> {
15 ICONS
16 .get(icon_name)
17 .map(|bytes| super::Data::Svg(crate::iced::widget::svg::Handle::from_memory(*bytes)))
18}
19
20#[cfg(any(not(unix), target_os = "macos"))]
21include!(concat!(env!("OUT_DIR"), "/bundled_icons.rs"));