widget/icon: Bundle icons on macOS, not just Windows
This commit is contained in:
parent
0d69cd9183
commit
46d9f0c344
4 changed files with 10 additions and 8 deletions
|
|
@ -4,12 +4,12 @@
|
|||
//! Embedded icons for platforms which do not support icon themes yet.
|
||||
|
||||
/// Icon bundling is not enabled on unix platforms.
|
||||
#[cfg(unix)]
|
||||
#[cfg(all(unix, not(target_os = "macos")))]
|
||||
pub fn get(icon_name: &str) -> Option<super::Data> {
|
||||
None
|
||||
}
|
||||
|
||||
#[cfg(not(unix))]
|
||||
#[cfg(any(not(unix), target_os = "macos"))]
|
||||
/// Get a bundled icon on non-unix platforms.
|
||||
pub fn get(icon_name: &str) -> Option<super::Data> {
|
||||
ICONS
|
||||
|
|
@ -17,5 +17,5 @@ pub fn get(icon_name: &str) -> Option<super::Data> {
|
|||
.map(|bytes| super::Data::Svg(crate::iced::widget::svg::Handle::from_memory(*bytes)))
|
||||
}
|
||||
|
||||
#[cfg(not(unix))]
|
||||
#[cfg(any(not(unix), target_os = "macos"))]
|
||||
include!(concat!(env!("OUT_DIR"), "/bundled_icons.rs"));
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ impl Named {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
#[cfg(all(unix, not(target_os = "macos")))]
|
||||
#[must_use]
|
||||
pub fn path(self) -> Option<PathBuf> {
|
||||
let name = &*self.name;
|
||||
|
|
@ -107,7 +107,7 @@ impl Named {
|
|||
result
|
||||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
#[cfg(any(not(unix), target_os = "macos"))]
|
||||
#[must_use]
|
||||
pub fn path(self) -> Option<PathBuf> {
|
||||
//TODO: implement icon lookup for Windows
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue