mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2025-01-09 17:58:43 +00:00
Force the Material theme since our UI relies on it
This commit is contained in:
parent
9ed40b5d9f
commit
2eee9c019f
1 changed files with 7 additions and 17 deletions
22
app/main.cpp
22
app/main.cpp
|
@ -635,29 +635,19 @@ int main(int argc, char *argv[])
|
||||||
// Create the identity manager on the main thread
|
// Create the identity manager on the main thread
|
||||||
IdentityManager::get();
|
IdentityManager::get();
|
||||||
|
|
||||||
#ifndef Q_OS_WINRT
|
// We require the Material theme
|
||||||
// Use the dense material dark theme by default
|
QQuickStyle::setStyle("Material");
|
||||||
if (!qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_STYLE")) {
|
|
||||||
qputenv("QT_QUICK_CONTROLS_STYLE", "Material");
|
// Our icons are styled for a dark theme, so we do not allow the user to override this
|
||||||
}
|
|
||||||
#else
|
|
||||||
// Use universal dark on WinRT
|
|
||||||
if (!qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_STYLE")) {
|
|
||||||
qputenv("QT_QUICK_CONTROLS_STYLE", "Universal");
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
if (!qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_MATERIAL_THEME")) {
|
|
||||||
qputenv("QT_QUICK_CONTROLS_MATERIAL_THEME", "Dark");
|
qputenv("QT_QUICK_CONTROLS_MATERIAL_THEME", "Dark");
|
||||||
}
|
|
||||||
|
// These are defaults that we allow the user to override
|
||||||
if (!qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_MATERIAL_ACCENT")) {
|
if (!qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_MATERIAL_ACCENT")) {
|
||||||
qputenv("QT_QUICK_CONTROLS_MATERIAL_ACCENT", "Purple");
|
qputenv("QT_QUICK_CONTROLS_MATERIAL_ACCENT", "Purple");
|
||||||
}
|
}
|
||||||
if (!qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_MATERIAL_VARIANT")) {
|
if (!qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_MATERIAL_VARIANT")) {
|
||||||
qputenv("QT_QUICK_CONTROLS_MATERIAL_VARIANT", "Dense");
|
qputenv("QT_QUICK_CONTROLS_MATERIAL_VARIANT", "Dense");
|
||||||
}
|
}
|
||||||
if (!qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_UNIVERSAL_THEME")) {
|
|
||||||
qputenv("QT_QUICK_CONTROLS_UNIVERSAL_THEME", "Dark");
|
|
||||||
}
|
|
||||||
|
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
QString initialView;
|
QString initialView;
|
||||||
|
|
Loading…
Reference in a new issue