Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
23 changes: 0 additions & 23 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion iced/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ iced_font_awesome.workspace = true
rfd.workspace = true
arboard = { workspace = true, optional = true }
tokio = { workspace = true, optional = true }
dark-light = { git = "https://github.com/rust-dark-light/dark-light", rev = "0f18d2fbcaa5d1c175db8aae7d53428988d7e961" }

[[example]]
name = "scope"
Expand Down
12 changes: 1 addition & 11 deletions iced/src/show.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,24 +222,14 @@ fn theme_plotive_to_iced(pv_style: &plotive::Style) -> iced::Theme {
}
}

fn system_theme() -> Option<plotive::Style> {
match dark_light::detect() {
Ok(dark_light::Mode::Light) => Some(plotive::Style::light()),
Ok(dark_light::Mode::Dark) => Some(plotive::Style::dark()),
_ => None,
}
}

fn theme_from_show<D>(show: &FigureShow<D>) -> Option<iced::Theme>
where
D: data::Source + ?Sized + 'static,
{
if let Some(style) = &show.style {
return Some(theme_plotive_to_iced(style));
}
if let Some(style) = system_theme() {
return Some(theme_plotive_to_iced(&style));
}

None
}

Expand Down
Loading