From ea409d372f15d6fc9710fd97c61ef0edefd37832 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Wed, 2 Feb 2022 17:31:36 +0100 Subject: [PATCH] fix review comments add --reverse option on command line add support in one more qml window Signed-off-by: Matthieu Gallien --- src/gui/application.cpp | 5 ++++- src/gui/tray/Window.qml | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gui/application.cpp b/src/gui/application.cpp index 18b01f6c2df7f..84b02ded691df 100644 --- a/src/gui/application.cpp +++ b/src/gui/application.cpp @@ -98,7 +98,8 @@ namespace { " --isvfsenabled : whether to set a VFS or non-VFS folder (1 for 'yes' or 0 for 'no') when creating an account via command-line.\n" " --remotedirpath : (optional) path to a remote subfolder when creating an account via command-line.\n" " --serverurl : a server URL to use when creating an account via command-line.\n" - " --forcelegacyconfigimport : forcefully import account configurations from legacy clients (if available).\n"; + " --forcelegacyconfigimport : forcefully import account configurations from legacy clients (if available).\n" + " --reverse : use a reverse layout direction.\n"; QString applicationTrPath() { @@ -724,6 +725,8 @@ void Application::parseOptions(const QStringList &options) _backgroundMode = true; } else if (option == QLatin1String("--version") || option == QLatin1String("-v")) { _versionOnly = true; + } else if (option == QLatin1String("--reverse")) { + setLayoutDirection(layoutDirection() == Qt::LeftToRight ? Qt::RightToLeft : Qt::LeftToRight); } else if (option.endsWith(QStringLiteral(APPLICATION_DOTVIRTUALFILE_SUFFIX))) { // virtual file, open it after the Folder were created (if the app is not terminated) QTimer::singleShot(0, this, [this, option] { openVirtualFile(option); }); diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index e1765681e5882..a2eb1de945a73 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -57,11 +57,11 @@ ApplicationWindow { toolTipText: Style.ncTextColor } - LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLef - LayoutMirroring.childrenInherit: true - readonly property int maxMenuHeight: Style.trayWindowHeight - Style.trayWindowHeaderHeight - 2 * Style.trayWindowBorderWidth + LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft + LayoutMirroring.childrenInherit: true + Component.onCompleted: Systray.forceWindowInit(trayWindow) // Close tray window when focus is lost (e.g. click somewhere else on the screen)