diff --git a/crates/settings/src/lib.rs b/crates/settings/src/lib.rs index 4922936d..1ca73d86 100644 --- a/crates/settings/src/lib.rs +++ b/crates/settings/src/lib.rs @@ -332,8 +332,8 @@ mod tests { } #[test] - fn missing_appearance_mode_falls_back_to_system() { + fn missing_appearance_mode_falls_back_to_dark() { let settings = json_with("").unwrap(); - assert_eq!(settings.appearance_mode, AppearanceMode::System); + assert_eq!(settings.appearance_mode, AppearanceMode::Dark); } } diff --git a/crates/theme/src/appearance.rs b/crates/theme/src/appearance.rs index 936751b6..c488050d 100644 --- a/crates/theme/src/appearance.rs +++ b/crates/theme/src/appearance.rs @@ -12,11 +12,12 @@ use crate::{Theme, ThemeMode}; /// it wherever their settings live; this crate never touches disk. #[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Serialize, Deserialize)] pub enum AppearanceMode { - /// Follow the OS. The default — matches every other native app on the - /// machine, including when the OS is set to switch at sunset. - #[default] + /// Follow the OS — matches every other native app on the machine, + /// including when the OS is set to switch at sunset. System, Light, + /// Paint dark regardless of the OS. + #[default] Dark, } @@ -62,7 +63,7 @@ pub fn init(mode: AppearanceMode, cx: &mut App) { Theme::change(resolve(mode, system), None, cx); } -/// The mode currently in effect (defaults to `System` before [`init`]). +/// The mode currently in effect (defaults to `Dark` before [`init`]). pub fn mode(cx: &App) -> AppearanceMode { cx.try_global::() .map(|state| state.mode) diff --git a/crates/theme/src/lib.rs b/crates/theme/src/lib.rs index 0e636e06..c824d068 100644 --- a/crates/theme/src/lib.rs +++ b/crates/theme/src/lib.rs @@ -66,7 +66,7 @@ pub const TABBAR_HEIGHT: Pixels = px(36.0); pub const SIDEBAR_WIDTH: Pixels = px(240.); pub fn init(cx: &mut App) { - appearance::init(AppearanceMode::System, cx); + appearance::init(AppearanceMode::default(), cx); Theme::sync_scrollbar_appearance(cx); } diff --git a/crates/theme/src/theme.rs b/crates/theme/src/theme.rs index 37982199..1a967554 100644 --- a/crates/theme/src/theme.rs +++ b/crates/theme/src/theme.rs @@ -5,8 +5,8 @@ use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Copy, Default, PartialEq, PartialOrd, Eq, Hash, Deserialize, Serialize)] pub enum ThemeMode { #[default] - Light, Dark, + Light, } impl ThemeMode {