diff --git a/src/common/widgets/widgetresourcedata.cpp b/src/common/widgets/widgetresourcedata.cpp index 849b6d553..9353137d1 100644 --- a/src/common/widgets/widgetresourcedata.cpp +++ b/src/common/widgets/widgetresourcedata.cpp @@ -1,6 +1,7 @@ #include #include +#include "c_cvars.h" #include "filesystem.h" #include "printf.h" #include "zstring.h" @@ -10,6 +11,12 @@ #include #endif +CUSTOM_CVARD(Int, ui_theme, 2, CVAR_ARCHIVE | CVAR_GLOBALCONFIG, "launcher theme. 0: auto, 1: dark, 2: light") +{ + if (self < 0) self = 0; + if (self > 2) self = 2; +} + FResourceFile* WidgetResources; bool IsZWidgetAvailable() @@ -23,7 +30,35 @@ void InitWidgetResources(const char* filename) if (!WidgetResources) I_FatalError("Unable to open %s", filename); - WidgetTheme::SetTheme(std::make_unique()); + bool use_dark = ui_theme != 2; + + if (ui_theme == 0) + { + // TODO: detect system theme + } + + if (use_dark) // light + { + // TODO: make a nice theme + WidgetTheme::SetTheme(std::make_unique()); + } + else + { + WidgetTheme::SetTheme(std::unique_ptr(new WidgetTheme{{ + Colorf::fromRgb(0xeee8d5), // background + Colorf::fromRgb(0x000000), // text + Colorf::fromRgb(0xfdf6e3), // headers / inputs + Colorf::fromRgb(0x000000), // headers / inputs text + Colorf::fromRgb(0xd7d2bf), // interactive elements + Colorf::fromRgb(0x000000), // interactive elements text + Colorf::fromRgb(0xa4c2e9), // hover / highlight + Colorf::fromRgb(0x000000), // hover / highlight text + Colorf::fromRgb(0x7ca2e9), // click + Colorf::fromRgb(0x000000), // click text + Colorf::fromRgb(0x586e75), // around elements + Colorf::fromRgb(0xbdb8a7) // between elements + }})); + } } void CloseWidgetResources() diff --git a/src/launcher/networkpage.cpp b/src/launcher/networkpage.cpp index d3eea0619..d2d6e5a23 100644 --- a/src/launcher/networkpage.cpp +++ b/src/launcher/networkpage.cpp @@ -223,9 +223,10 @@ HostSubPage::HostSubPage(NetworkPage* main, const FStartupSelectionInfo& info) : PortHintLabel = new TextLabel(this); TeamHintLabel = new TextLabel(this); - MaxPlayerHintLabel->SetStyleColor("color", Colorf::fromRgba8(160, 160, 160)); - PortHintLabel->SetStyleColor("color", Colorf::fromRgba8(160, 160, 160)); - TeamHintLabel->SetStyleColor("color", Colorf::fromRgba8(160, 160, 160)); + // TODO: Themeable de-emphasis + // MaxPlayerHintLabel->SetStyleColor("color", Colorf::fromRgba8(160, 160, 160)); + // PortHintLabel->SetStyleColor("color", Colorf::fromRgba8(160, 160, 160)); + // TeamHintLabel->SetStyleColor("color", Colorf::fromRgba8(160, 160, 160)); } void HostSubPage::SetValues(FStartupSelectionInfo& info) const @@ -397,8 +398,9 @@ JoinSubPage::JoinSubPage(NetworkPage* main, const FStartupSelectionInfo& info) : AddressPortHintLabel = new TextLabel(this); TeamHintLabel = new TextLabel(this); - AddressPortHintLabel->SetStyleColor("color", Colorf::fromRgba8(160, 160, 160)); - TeamHintLabel->SetStyleColor("color", Colorf::fromRgba8(160, 160, 160)); + // TODO: Themeable de-emphasis + // AddressPortHintLabel->SetStyleColor("color", Colorf::fromRgba8(160, 160, 160)); + // TeamHintLabel->SetStyleColor("color", Colorf::fromRgba8(160, 160, 160)); } void JoinSubPage::SetValues(FStartupSelectionInfo& info) const