mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 21:15:55 +03:00
Change default Qt quick control style depending on the platform.
Signed-off-by: Camila Ayres <hello@camilasan.com>
This commit is contained in:
parent
651596db78
commit
6ff67c6660
1 changed files with 19 additions and 1 deletions
|
@ -70,10 +70,28 @@ int main(int argc, char **argv)
|
|||
QSurfaceFormat::setDefaultFormat(surfaceFormat);
|
||||
|
||||
QQuickWindow::setTextRenderType(QQuickWindow::NativeTextRendering);
|
||||
QQuickStyle::setStyle(QStringLiteral("Fusion"));
|
||||
|
||||
auto style = QStringLiteral("Fusion");
|
||||
|
||||
#ifdef Q_OS_MAC
|
||||
style = QStringLiteral("macOS");
|
||||
#endif
|
||||
|
||||
OCC::Application app(argc, argv);
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
// The Windows style still has pixelated elements with Qt 5.6,
|
||||
// it's recommended to use the Fusion style in this case, even
|
||||
// though it looks slightly less native. Check here after the
|
||||
// QApplication was constructed, but before any QWidget is
|
||||
// constructed.
|
||||
if (app.devicePixelRatio() > 1) {
|
||||
style = "Windows";
|
||||
}
|
||||
#endif // Q_OS_WIN
|
||||
|
||||
QQuickStyle::setStyle(style);
|
||||
|
||||
#ifndef Q_OS_WIN
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue