Skip to content

Commit

Permalink
fix review comments
Browse files Browse the repository at this point in the history
add --reverse option on command line

add support in one more qml window

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
  • Loading branch information
mgallien committed May 4, 2022
1 parent 7fac637 commit d7cc9f8
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/gui/UserStatusSelectorDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Window {

flags: Qt.Dialog

LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLef
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
LayoutMirroring.childrenInherit: true

UserStatusSelector {
Expand Down
5 changes: 4 additions & 1 deletion src/gui/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ namespace {
" --logflush : flush the log file after every write.\n"
" --logdebug : also output debug-level messages in the log.\n"
" --confdir <dirname> : Use the given configuration folder.\n"
" --background : launch the application in the background.\n";
" --background : launch the application in the background.\n"
" --reverse : use a reverse layout direction.\n";

QString applicationTrPath()
{
Expand Down Expand Up @@ -640,6 +641,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); });
Expand Down
3 changes: 3 additions & 0 deletions src/gui/tray/FileActivityDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ Window {

property alias model: activityModel

LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
LayoutMirroring.childrenInherit: true

NC.FileActivityListModel {
id: activityModel
}
Expand Down
6 changes: 3 additions & 3 deletions src/gui/tray/Window.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ Window {

property int fileActivityDialogObjectId: -1

LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLef
LayoutMirroring.childrenInherit: true

readonly property int maxMenuHeight: Style.trayWindowHeight - Style.trayWindowHeaderHeight - 2 * Style.trayWindowBorderWidth

function openFileActivityDialog(objectName, objectId) {
Expand All @@ -36,6 +33,9 @@ Window {
fileActivityDialogLoader.refresh();
}

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)
Expand Down

0 comments on commit d7cc9f8

Please sign in to comment.