refactor(cosmic-theme): Get ThemeMode version from cosmic config derive

This commit is contained in:
Michael Aaron Murphy 2024-03-05 16:06:10 +01:00 committed by Jeremy Soller
parent 4f07d05ee8
commit f794c53277

View file

@ -30,13 +30,12 @@ impl ThemeMode {
config.get::<bool>("is_dark") config.get::<bool>("is_dark")
} }
/// version of the theme pub const fn version() -> u64 {
pub fn version() -> u64 { Self::VERSION
1
} }
/// Get the config for the theme mode /// Get the config for the theme mode
pub fn config() -> Result<Config, cosmic_config::Error> { pub fn config() -> Result<Config, cosmic_config::Error> {
Config::new(THEME_MODE_ID, Self::version()) Config::new(THEME_MODE_ID, Self::VERSION)
} }
} }