Expand description
§native-theme
Cross-platform native theme detection and loading for Rust GUI applications.
Any Rust GUI app can look native on any platform by loading a single theme file or reading live OS settings, without coupling to any specific toolkit.
Re-exports§
pub use color::Rgba;pub use error::Error;pub use model::IconData;pub use model::IconProvider;pub use model::IconRole;pub use model::IconSet;pub use model::NativeTheme;pub use model::ThemeColors;pub use model::ThemeFonts;pub use model::ThemeGeometry;pub use model::ThemeSpacing;pub use model::ThemeVariant;pub use model::WidgetMetrics;pub use model::bundled_icon_by_name;pub use model::bundled_icon_svg;pub use model::icons::icon_name;pub use model::icons::system_icon_set;pub use model::icons::system_icon_theme;
Modules§
- color
- error
- macos
- macOS theme reader: reads semantic NSColor values with P3-to-sRGB conversion, resolves both light and dark appearance variants via NSAppearance, and reads system and monospace fonts via NSFont.
- model
- presets
- Bundled theme presets and TOML serialization API.
Macros§
- impl_
merge - Generates
merge()andis_empty()methods for theme structs.
Enums§
- Linux
Desktop - Desktop environments recognized on Linux.
Functions§
- detect_
linux_ de - Parse
XDG_CURRENT_DESKTOP(a colon-separated list) and return the recognized desktop environment. - from_
system - Read the current system theme, auto-detecting the platform and desktop environment.
- from_
system_ async - Async version of
from_system()that uses D-Bus portal backend detection to improve desktop environment heuristics on Linux. - load_
custom_ icon - Load an icon from any
IconProvider, dispatching through the standard platform loading chain. - load_
icon - Load an icon for the given role using the specified icon set.
- load_
system_ icon_ by_ name - Load a system icon by its platform-specific name string.
- system_
is_ dark - Detect whether the system is using a dark color scheme.
Type Aliases§
- Result
- Convenience Result type alias for this crate.