Set window theme to match color scheme of active theme
This commit is contained in:
parent
e92c87061d
commit
74425d5cb1
4 changed files with 40 additions and 6 deletions
|
|
@ -258,7 +258,10 @@ pub trait Base {
|
|||
/// Returns the default theme for the preferred [`Mode`].
|
||||
fn default(preference: Mode) -> Self;
|
||||
|
||||
/// Returns the default base [`Style`] of a theme.
|
||||
/// Returns the [`Mode`] of the theme.
|
||||
fn mode(&self) -> Mode;
|
||||
|
||||
/// Returns the default base [`Style`] of the theme.
|
||||
fn base(&self) -> Style;
|
||||
|
||||
/// Returns the color [`Palette`] of the theme.
|
||||
|
|
@ -295,6 +298,14 @@ impl Base for Theme {
|
|||
}
|
||||
}
|
||||
|
||||
fn mode(&self) -> Mode {
|
||||
if self.extended_palette().is_dark {
|
||||
Mode::Dark
|
||||
} else {
|
||||
Mode::Light
|
||||
}
|
||||
}
|
||||
|
||||
fn base(&self) -> Style {
|
||||
default(self)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue