-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic change theme based on OS appearance #582
Conversation
9f71765
to
f51c956
Compare
a35c56f
to
01d771c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff! Works on gnome
data/src/appearance.rs
Outdated
pub fn new(first: Theme, second: Option<Theme>) -> Selected { | ||
match second { | ||
Some(second) => Selected::Dynamic { | ||
light: first, | ||
dark: second, | ||
}, | ||
None => Selected::Static(first), | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: It might be nice to instead have separate constructors: Selected::static
vs Selected::dynamic(light: Theme, dark: Theme)
and then call-site determines which is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixing this before i merge.
5cd1ae8
to
a83f0d1
Compare
This PR extends
theme
configuration key to take alight
and adark
variant. Doing so will enable a Halloy to dynamically pick theme based on OS appearance.Statically setting a theme, works like before: