pub fn from_system() -> Result<NativeTheme>Expand description
Read the current system theme, auto-detecting the platform and desktop environment.
§Platform Behavior
- macOS: Calls
from_macos()when themacosfeature is enabled. Reads both light and dark variants via NSAppearance. - Linux (KDE): Calls
from_kde()whenXDG_CURRENT_DESKTOPcontains “KDE” and thekdefeature is enabled. - Linux (other): Returns the bundled Adwaita preset. For live GNOME
portal data, call
from_gnome()directly (requiresportal-tokioorportal-async-iofeature). - Windows: Calls
from_windows()when thewindowsfeature is enabled. - Other platforms: Returns
Error::Unsupported.
§Errors
Error::Unsupportedif the platform has no reader or the required feature is not enabled.Error::Unavailableif the platform reader cannot access theme data.