Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ bitflags = "2.0"
bytemuck = { version = "1.0", features = ["derive"] }
bytes = "1.6"
cosmic-text = "0.12"
dark-light = "1.0"
dark-light = "2.0"
futures = "0.3"
glam = "0.25"
glyphon = { git = "https://github.com/hecrj/glyphon.git", rev = "09712a70df7431e9a3b1ac1bbd4fb634096cb3b4" }
Expand Down
13 changes: 6 additions & 7 deletions core/src/theme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,12 @@ impl Default for Theme {
{
use std::sync::LazyLock;

static DEFAULT: LazyLock<Theme> =
LazyLock::new(|| match dark_light::detect() {
dark_light::Mode::Dark => Theme::Dark,
dark_light::Mode::Light | dark_light::Mode::Default => {
Theme::Light
}
});
static DEFAULT: LazyLock<Theme> = LazyLock::new(|| match dark_light::detect() {
Ok(dark_light::Mode::Dark) => Theme::Dark,
Ok(dark_light::Mode::Light) | Ok(dark_light::Mode::Unspecified) | Err(_) => {
Theme::Light
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Ok(dark_light::Mode::Light) | Ok(dark_light::Mode::Unspecified) | Err(_) => {
Theme::Light
_ => Theme::Light,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally I would've made this change before even opening the PR, but I decided to preserve the verbosity of the original just-in-case there's a reason for the verbosity

}
});

DEFAULT.clone()
}
Expand Down