pub enum AppIcon {
File(PathBuf),
Bytes(Arc<[u8]>),
Named {
name: String,
image: Option<Arc<AppIcon>>,
},
Themed {
light: Arc<AppIcon>,
dark: Arc<AppIcon>,
},
}Expand description
The app’s icon, decoded by the platform: PNG everywhere, other formats
where the platform reads them (an .ico file on Windows, with its
sizes). Give it large (256 or 512 pixels square): platforms scale it
down.
Variants§
File(PathBuf)
Bytes(Arc<[u8]>)
An image file’s bytes, as include_bytes! gives them.
Named
An icon from the user’s icon theme, by name, as Linux apps give
theirs (installed with the app); image where there’s no theme
(macOS, Windows). See AppIcon::named.
Themed
An image with another for dark backgrounds, where the platform
wants one. See AppIcon::dark.
Implementations§
Source§impl AppIcon
impl AppIcon
pub fn file(path: impl Into<PathBuf>) -> AppIcon
pub fn bytes(bytes: impl Into<Arc<[u8]>>) -> AppIcon
Sourcepub fn named(name: impl Into<String>) -> AppIcon
pub fn named(name: impl Into<String>) -> AppIcon
An icon from the icon theme, by name: Linux shows it; macOS and
Windows show the image given with it, or nothing.
Sourcepub fn image(self, image: AppIcon) -> AppIcon
pub fn image(self, image: AppIcon) -> AppIcon
The image a named icon shows where there’s no icon
theme. Other icons are images already, and stay as they are.
Sourcepub fn dark(self, dark: AppIcon) -> AppIcon
pub fn dark(self, dark: AppIcon) -> AppIcon
The image to show on a dark background, where the platform doesn’t
recolor the icon for it: Windows’ tray on a dark taskbar. Elsewhere
the image itself shows: macOS tints the tray’s image for the menu
bar, Linux recolors a theme’s symbolic icons, and nothing tells an
app what’s under a Linux tray (GNOME’s top bar is dark in light
mode too). A named icon’s image takes it, in either
order with image.
Trait Implementations§
Source§impl IntoValue<AppIcon> for &str
A name from the icon theme: .icon("player-symbolic").
impl IntoValue<AppIcon> for &str
A name from the icon theme: .icon("player-symbolic").