Skip to main content

Crate native_theme

Crate native_theme 

Source
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::ParseColorError;
pub use color::Rgba;
pub use error::Error;
pub use error::ThemeResolutionError;
pub use model::AnimatedIcon;
pub use model::ButtonTheme;
pub use model::CardTheme;
pub use model::CheckboxTheme;
pub use model::ComboBoxTheme;
pub use model::DialogButtonOrder;
pub use model::DialogTheme;
pub use model::ExpanderTheme;
pub use model::FontSpec;
pub use model::IconData;
pub use model::IconProvider;
pub use model::IconRole;
pub use model::IconSet;
pub use model::IconSizes;
pub use model::InputTheme;
pub use model::LinkTheme;
pub use model::ListTheme;
pub use model::MenuTheme;
pub use model::PopoverTheme;
pub use model::ProgressBarTheme;
pub use model::ResolvedFontSpec;
pub use model::ResolvedIconSizes;
pub use model::ResolvedTextScale;
pub use model::ResolvedTextScaleEntry;
pub use model::ResolvedThemeDefaults;
pub use model::ResolvedThemeSpacing;
pub use model::ResolvedThemeVariant;
pub use model::ScrollbarTheme;
pub use model::SegmentedControlTheme;
pub use model::SeparatorTheme;
pub use model::SidebarTheme;
pub use model::SliderTheme;
pub use model::SpinnerTheme;
pub use model::SplitterTheme;
pub use model::StatusBarTheme;
pub use model::SwitchTheme;
pub use model::TabTheme;
pub use model::TextScale;
pub use model::TextScaleEntry;
pub use model::ThemeDefaults;
pub use model::ThemeSpacing;
pub use model::ThemeSpec;
pub use model::ThemeVariant;
pub use model::ToolbarTheme;
pub use model::TooltipTheme;
pub use model::TransformAnimation;
pub use model::WindowTheme;
pub use model::bundled_icon_by_name;
pub use model::bundled_icon_svg;
pub use model::icons::detect_icon_theme;
pub use model::icons::icon_name;
pub use model::icons::system_icon_set;
pub use model::icons::system_icon_theme;

Modules§

color
Color types and sRGB utilities.
error
Error types for theme operations.
model
Theme data model types.
presets
Bundled theme presets. Bundled theme presets and TOML serialization API.

Structs§

SystemTheme
Result of the OS-first pipeline. Holds both resolved variants.

Enums§

LinuxDesktop
Desktop environments recognized on Linux.

Functions§

detect_is_dark
Detect whether the system is using a dark color scheme without caching.
detect_linux_de
Parse XDG_CURRENT_DESKTOP (a colon-separated list) and return the recognized desktop environment.
detect_reduced_motion
Detect whether the user prefers reduced motion without caching.
diagnose_platform_support
Check whether OS theme detection is available on this platform.
is_freedesktop_theme_available
Check whether a freedesktop icon theme is installed on this system.
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_icon_from_theme
Load an icon using a specific freedesktop icon theme instead of the system default.
load_system_icon_by_name
Load a system icon by its platform-specific name string.
loading_indicator
Return the loading/spinner animation for the given icon set.
platform_preset_name
Map the current platform to its matching live preset name.
prefers_reduced_motion
Query whether the user prefers reduced motion.
system_is_dark
Detect whether the system is using a dark color scheme.

Type Aliases§

Result
Convenience Result type alias for this crate.