feat: load preferred theme instead of using default
This commit is contained in:
parent
abf143cb9e
commit
ac2e129e4d
1 changed files with 10 additions and 2 deletions
|
|
@ -31,8 +31,16 @@ pub enum AppTheme {
|
||||||
impl AppTheme {
|
impl AppTheme {
|
||||||
pub fn theme(&self) -> theme::Theme {
|
pub fn theme(&self) -> theme::Theme {
|
||||||
match self {
|
match self {
|
||||||
Self::Dark => theme::Theme::dark(),
|
Self::Dark => {
|
||||||
Self::Light => theme::Theme::light(),
|
let mut t = theme::system_dark();
|
||||||
|
t.theme_type.prefer_dark(Some(true));
|
||||||
|
t
|
||||||
|
}
|
||||||
|
Self::Light => {
|
||||||
|
let mut t = theme::system_light();
|
||||||
|
t.theme_type.prefer_dark(Some(false));
|
||||||
|
t
|
||||||
|
}
|
||||||
Self::System => theme::system_preference(),
|
Self::System => theme::system_preference(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue