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 {
|
||||
pub fn theme(&self) -> theme::Theme {
|
||||
match self {
|
||||
Self::Dark => theme::Theme::dark(),
|
||||
Self::Light => theme::Theme::light(),
|
||||
Self::Dark => {
|
||||
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(),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue