pub enum IconSetChoice {
Default(String),
System,
Freedesktop(String),
Material,
Lucide,
}Expand description
The user’s icon set selection mode.
Represents the user’s intent for which icons to display. The key
invariant: only Default is re-derived on theme changes.
All other variants represent an explicit user choice that is preserved
across theme re-applications.
Variants§
Default(String)
Follow the theme preset’s recommendation.
The String is the preset’s icon_theme name (e.g. “Adwaita”),
used for display (“default (Adwaita)”) and for loading when the
icon set is Freedesktop.
This is the ONLY variant that gets overwritten on theme change.
It is only constructed via default_icon_choice(), which
guarantees the theme is available (bundled sets are always
available; freedesktop themes are checked via
is_freedesktop_theme_available before returning this variant).
System
Use the OS-configured icon theme.
Resolved at load time via system_icon_set().
The display label (“system (breeze-dark)”) is computed dynamically
from system_icon_theme(),
so it tracks runtime OS theme changes. Where detection fails the
label gives the reason, system (unavailable: <reason>), and the
freedesktop loaders search no theme for this choice.
Freedesktop(String)
User explicitly picked a specific installed freedesktop icon theme.
The String is the theme directory name (e.g. “char-white”,
“breeze”, “Papirus”). Loaded via IconSet::Freedesktop with
.theme(name).
Material
Google Material Symbols (bundled).
Lucide
Lucide Icons (bundled).
Implementations§
Source§impl IconSetChoice
impl IconSetChoice
Sourcepub fn effective_icon_set(&self, theme_icon_set: IconSet) -> IconSet
pub fn effective_icon_set(&self, theme_icon_set: IconSet) -> IconSet
The effective IconSet loading mechanism for this choice.
For Default, returns the theme’s icon set
(caller passes it in).
For Freedesktop, always returns
IconSet::Freedesktop.
For others, returns the corresponding bundled or system set.
Sourcepub fn freedesktop_theme(&self) -> Option<&str>
pub fn freedesktop_theme(&self) -> Option<&str>
The freedesktop theme name to pass to FreedesktopLoader::theme, if any.
Returns Some(name) for Default and
Freedesktop variants.
Returns None for System, Material,
Lucide.
The caller is responsible for only passing the result to
FreedesktopLoader::theme when the effective icon set is
IconSet::Freedesktop. For bundled sets (Material, Lucide),
the theme name is not used by the loader.
Sourcepub fn follows_preset(&self) -> bool
pub fn follows_preset(&self) -> bool
Whether this choice should be re-derived when the theme changes.
Only Default follows the preset. All others
are explicit user choices that must be preserved.