mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Merge pull request #7812 from nextcloud/bugfix/fluent-style
use correct qml style on Windows
This commit is contained in:
commit
c151888683
@ -78,25 +78,30 @@ int main(int argc, char **argv)
|
||||
|
||||
QQuickWindow::setTextRenderType(QQuickWindow::NativeTextRendering);
|
||||
|
||||
auto style = QStringLiteral("Fusion");
|
||||
auto qmlStyle = QStringLiteral("Fusion");
|
||||
auto widgetsStyle = QStringLiteral("");
|
||||
|
||||
#if defined Q_OS_MAC
|
||||
style = QStringLiteral("macOS");
|
||||
#endif
|
||||
|
||||
QQuickStyle::setStyle(style);
|
||||
QQuickStyle::setFallbackStyle(QStringLiteral("Fusion"));
|
||||
|
||||
#if defined Q_OS_WIN
|
||||
qmlStyle = QStringLiteral("macOS");
|
||||
#elif defined Q_OS_WIN
|
||||
if (QOperatingSystemVersion::current().version() < QOperatingSystemVersion::Windows11.version()) {
|
||||
QApplication::setStyle(QStyleFactory::create("Universal"));
|
||||
qmlStyle = QStringLiteral("Universal");
|
||||
widgetsStyle = QStringLiteral("Fusion");
|
||||
} else {
|
||||
style = QStringLiteral("FluentWinUI3");
|
||||
qmlStyle = QStringLiteral("FluentWinUI3");
|
||||
widgetsStyle = QStringLiteral("windows11");
|
||||
}
|
||||
#endif
|
||||
|
||||
QQuickStyle::setStyle(qmlStyle);
|
||||
QQuickStyle::setFallbackStyle(QStringLiteral("Fusion"));
|
||||
|
||||
OCC::Application app(argc, argv);
|
||||
|
||||
if (!widgetsStyle.isEmpty()) {
|
||||
QApplication::setStyle(QStyleFactory::create(widgetsStyle));
|
||||
}
|
||||
|
||||
#ifndef Q_OS_WIN
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user