Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable reversed locale layout (RTL) in QML #4240

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/gui/ResolveConflictsDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ ApplicationWindow {
flags: Qt.Window | Qt.Dialog
visible: true

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

width: Style.minimumWidthResolveConflictsDialog
height: Style.minimumHeightResolveConflictsDialog
minimumWidth: Style.minimumWidthResolveConflictsDialog
Expand Down
5 changes: 4 additions & 1 deletion src/gui/application.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*

Check notice on line 1 in src/gui/application.cpp

View workflow job for this annotation

GitHub Actions / build

Run clang-format on src/gui/application.cpp

File src/gui/application.cpp does not conform to Custom style guidelines. (lines 104, 105)
* Copyright (C) by Duncan Mac-Vicar P. <duncan@kde.org>
* Copyright (C) by Klaas Freitag <freitag@owncloud.com>
* Copyright (C) by Daniel Molkentin <danimo@owncloud.com>
Expand Down Expand Up @@ -101,7 +101,8 @@
" --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()
{
Expand Down Expand Up @@ -814,6 +815,8 @@
_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/filedetails/FileDetailsWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ ApplicationWindow {
property var accountState
property string localPath: ""

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

width: 400
height: 500
minimumWidth: 300
Expand Down
3 changes: 3 additions & 0 deletions src/gui/macOS/ui/FileProviderEvictionDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ ApplicationWindow {
property var materialisedItemsModel: null
property string accountUserIdAtHost: ""

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

title: qsTr("Evict materialised files")
color: palette.base
flags: Qt.Dialog | Qt.WindowStaysOnTopHint
Expand Down
3 changes: 3 additions & 0 deletions src/gui/tray/CallNotificationDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ ApplicationWindow {
Systray.destroyDialog(root);
}

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

width: root.windowWidth
height: rootBackground.height

Expand Down
3 changes: 3 additions & 0 deletions src/gui/tray/EditFileLocallyLoadingDialog.qml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ ApplicationWindow {

color: palette.base

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

width: 320
height: contentLayout.implicitHeight

Expand Down
3 changes: 3 additions & 0 deletions src/gui/tray/MainWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ import com.nextcloud.desktopclient
ApplicationWindow {
id: trayWindow

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

title: Systray.windowTitle
// If the main dialog is displayed as a regular window we want it to be quadratic
width: Systray.useNormalWindow ? Style.trayWindowHeight : Style.trayWindowWidth
Expand Down
Loading