Add darkmode support for the settings window (#494)

This commit is contained in:
Bartosz Sosnowski
2019-10-16 10:21:44 +02:00
committed by GitHub
parent c8039828fa
commit 52b15f29ad
22 changed files with 343 additions and 59 deletions

View File

@@ -50,6 +50,10 @@ WindowsColors::Color WindowsColors::get_accent_color() {
WindowsColors::Color WindowsColors::get_background_color() {
winrt::Windows::UI::ViewManagement::UISettings uiSettings;
return uiSettings.GetColorValue(winrt::Windows::UI::ViewManagement::UIColorType::Background);
}
bool WindowsColors::is_dark_mode() {
return rgb_color(get_background_color()) == 0;
}
bool WindowsColors::update() {

View File

@@ -16,7 +16,7 @@ struct WindowsColors {
static Color get_accent_dark_1_color();
static Color get_accent_color();
static Color get_background_color();
static bool is_dark_mode();
// Update colors - returns true if the values where changed
bool update();