From c8edb11228cc3a5d1b290b3bc30071331ee9c6b6 Mon Sep 17 00:00:00 2001 From: Camila Date: Tue, 25 May 2021 15:07:21 +0200 Subject: [PATCH 1/6] Fix QML warning: Accessible must be attached to an Item. Signed-off-by: Camila --- src/gui/tray/Window.qml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index 8594b660e9bc9..aa717b5641103 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -21,9 +21,6 @@ Window { readonly property int maxMenuHeight: Style.trayWindowHeight - Style.trayWindowHeaderHeight - 2 * Style.trayWindowBorderWidth - Accessible.role: Accessible.Application - Accessible.name: qsTr("Nextcloud desktop main dialog") - Component.onCompleted: Systray.forceWindowInit(trayWindow) // Close tray window when focus is lost (e.g. click somewhere else on the screen) @@ -154,9 +151,6 @@ Window { radius: Style.currentAccountButtonRadius } - Accessible.role: PopupMenu - Accessible.name: qsTr("Account switcher and settings menu") - onClosed: { // HACK: reload account Instantiator immediately by restting it - could be done better I guess // see also onVisibleChanged above @@ -413,6 +407,8 @@ Window { source: "qrc:///client/theme/white/caret-down.svg" sourceSize.width: Style.accountDropDownCaretSize sourceSize.height: Style.accountDropDownCaretSize + Accessible.role: PopupMenu + Accessible.name: qsTr("Account switcher and settings menu") } } } @@ -506,9 +502,6 @@ Window { radius: 2 } - Accessible.role: Accessible.PopupMenu - Accessible.name: qsTr("Apps menu") - Instantiator { id: appsMenuInstantiator model: UserAppsModel @@ -532,6 +525,9 @@ Window { anchors.margins: 1 color: appEntry.hovered ? Style.lightHover : "transparent" } + + Accessible.role: Accessible.PopupMenu + Accessible.name: qsTr("Apps menu") } Accessible.role: Accessible.MenuItem From 5585f61cc0205cf8d39a239ccc64d8f0d746af9c Mon Sep 17 00:00:00 2001 From: Camila Date: Tue, 25 May 2021 21:12:41 +0200 Subject: [PATCH 2/6] Fix QML warning: Detected anchors on an item that is managed by a layout. Signed-off-by: Camila --- src/gui/tray/Window.qml | 41 ++++++++++++++++++++++------------------- theme/Style/Style.qml | 1 + 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index aa717b5641103..f708f3b644071 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -354,10 +354,9 @@ Window { Column { id: accountLabels spacing: Style.userStatusSpacing - Layout.alignment: Qt.AlignLeft + Layout.alignment: Qt.AlignLeft | Qt.AlignTop Layout.leftMargin: Style.userStatusSpacing - anchors.top: currentAccountAvatar.top - anchors.topMargin: Style.userStatusSpacing + Layout.topMargin: Style.accountLabelsLayoutTopMargin Label { id: currentAccountUser width: Style.currentAccountLabelWidth @@ -419,6 +418,7 @@ Window { spacing: 0 Layout.preferredWidth: Style.trayWindowHeaderHeight Layout.preferredHeight: Style.trayWindowHeaderHeight + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter HeaderButton { id: openLocalFolderButton @@ -436,24 +436,27 @@ Window { radius: width*0.5 z: 1 } - } - - Image { - id: folderStateIndicator - visible: UserModel.currentUser.hasLocalFolder - source: UserModel.currentUser.isConnected - ? Style.stateOnlineImageSource - : Style.stateOfflineImageSource - cache: false - anchors.top: openLocalFolderButton.verticalCenter - anchors.left: openLocalFolderButton.horizontalCenter - - sourceSize.width: Style.folderStateIndicatorSize - sourceSize.height: Style.folderStateIndicatorSize - Accessible.role: Accessible.Indicator - Accessible.name: UserModel.currentUser.isConnected ? qsTr("Connected") : qsTr("Disconnected") + Image { + id: folderStateIndicator + visible: UserModel.currentUser.hasLocalFolder + source: UserModel.currentUser.isConnected + ? Style.stateOnlineImageSource + : Style.stateOfflineImageSource + cache: false + + anchors.top: openLocalFolderButton.verticalCenter + anchors.left: openLocalFolderButton.horizontalCenter + sourceSize.width: Style.folderStateIndicatorSize + sourceSize.height: Style.folderStateIndicatorSize + + Accessible.role: Accessible.Indicator + Accessible.name: UserModel.currentUser.isConnected ? qsTr("Connected") : qsTr("Disconnected") + z: 2 + } } + + Accessible.role: Accessible.Button Accessible.name: qsTr("Open local folder of current account") diff --git a/theme/Style/Style.qml b/theme/Style/Style.qml index 9e5233c4ea6ee..2be542e5ec134 100644 --- a/theme/Style/Style.qml +++ b/theme/Style/Style.qml @@ -52,6 +52,7 @@ QtObject { property int accountLabelsSpacing: 4 property int accountLabelsAnchorsMargin: 7 property int accountLabelsLayoutMargin: 9 + property int accountLabelsLayoutTopMargin: 12 // Visual behaviour property bool hoverEffectsEnabled: true From 19e581657d44df403f299a3f8770b66b69aab1ba Mon Sep 17 00:00:00 2001 From: Camila Date: Tue, 25 May 2021 22:17:33 +0200 Subject: [PATCH 3/6] Fix QML warning: Cannot specify left, right... anchors for items inside Row. Signed-off-by: Camila --- src/gui/tray/UserLine.qml | 26 +++++++++----------------- src/gui/tray/Window.qml | 14 ++++++-------- theme/Style/Style.qml | 4 ++-- 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/src/gui/tray/UserLine.qml b/src/gui/tray/UserLine.qml index 58b26f0c6f755..8945b656dffc9 100644 --- a/src/gui/tray/UserLine.qml +++ b/src/gui/tray/UserLine.qml @@ -61,7 +61,7 @@ MenuItem { id: accountControlRowLayout height: accountButton.height width: accountButton.width - spacing: 0 + spacing: Style.userStatusSpacing Image { id: accountAvatar Layout.leftMargin: 7 @@ -99,15 +99,10 @@ MenuItem { Column { id: accountLabels - spacing: Style.accountLabelsSpacing - Layout.alignment: Qt.AlignLeft - Layout.leftMargin: Style.accountLabelsLayoutMargin - anchors.top: accountAvatar.top - anchors.topMargin: Style.userStatusAnchorsMargin - anchors.left: accountAvatar.right - anchors.leftMargin: Style.accountLabelsAnchorsMargin + Layout.leftMargin: Style.accountLabelsSpacing Label { id: accountUser + Layout.alignment: Qt.AlignLeft | Qt.AlignBottom width: 128 text: name elide: Text.ElideRight @@ -115,11 +110,12 @@ MenuItem { font.pixelSize: Style.topLinePixelSize font.bold: true } - Row { + RowLayout { id: userStatus visible: model.isConnected && model.serverHasUserStatus - anchors.top: accountUser.bottom + spacing: Style.userStatusAnchorsMargin + Layout.alignment: Qt.AlignLeft | Qt.AlignTop Label { id: emoji visible: model.statusEmoji !== "" @@ -128,9 +124,8 @@ MenuItem { } Label { id: message - anchors.bottom: emoji.bottom - anchors.left: emoji.right - anchors.leftMargin: emoji.width + Style.userStatusSpacing + Layout.alignment: Qt.AlignLeft | Qt.AlignBottom + Layout.leftMargin: Style.userStatusAnchorsMargin visible: model.statusMessage !== "" width: Style.currentAccountLabelWidth text: statusMessage @@ -141,10 +136,7 @@ MenuItem { } Label { id: accountServer - anchors.top: userStatus.bottom - anchors.topMargin: message.visible - ? message.height + Style.accountServerAnchorsMargin - : Style.userStatusAnchorsMargin + Layout.alignment: Qt.AlignLeft | Qt.AlignBottom width: Style.currentAccountLabelWidth text: server elide: Text.ElideRight diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index f708f3b644071..d5afdef76af55 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -353,12 +353,12 @@ Window { Column { id: accountLabels - spacing: Style.userStatusSpacing - Layout.alignment: Qt.AlignLeft | Qt.AlignTop + spacing: 0 + Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter Layout.leftMargin: Style.userStatusSpacing - Layout.topMargin: Style.accountLabelsLayoutTopMargin Label { id: currentAccountUser + Layout.alignment: Qt.AlignLeft | Qt.AlignBottom width: Style.currentAccountLabelWidth text: UserModel.currentUser.name elide: Text.ElideRight @@ -366,11 +366,11 @@ Window { font.pixelSize: Style.topLinePixelSize font.bold: true } - Row { + RowLayout { id: currentUserStatus visible: UserModel.currentUser.isConnected && UserModel.currentUser.serverHasUserStatus - anchors.top: currentAccountUser.bottom + spacing: Style.accountLabelsSpacing Label { id: emoji visible: UserModel.currentUser.statusEmoji !== "" @@ -379,9 +379,7 @@ Window { } Label { id: message - anchors.bottom: emoji.bottom - anchors.left: emoji.right - anchors.leftMargin: emoji.width + Style.userStatusSpacing + Layout.alignment: Qt.AlignLeft | Qt.AlignBottom visible: UserModel.currentUser.statusMessage !== "" width: Style.currentAccountLabelWidth text: UserModel.currentUser.statusMessage !== "" diff --git a/theme/Style/Style.qml b/theme/Style/Style.qml index 2be542e5ec134..ea5aabde0236a 100644 --- a/theme/Style/Style.qml +++ b/theme/Style/Style.qml @@ -51,8 +51,8 @@ QtObject { property int accountServerAnchorsMargin: 10 property int accountLabelsSpacing: 4 property int accountLabelsAnchorsMargin: 7 - property int accountLabelsLayoutMargin: 9 - property int accountLabelsLayoutTopMargin: 12 + property int accountLabelsLayoutMargin: 12 + property int accountLabelsLayoutTopMargin: 10 // Visual behaviour property bool hoverEffectsEnabled: true From f3c17c747aa3090f49b9f3c38890af1a8b5dab9c Mon Sep 17 00:00:00 2001 From: Camila Date: Tue, 1 Jun 2021 12:48:26 +0200 Subject: [PATCH 4/6] Fix compiling warning: multiple definitions of stateOnlineImageSource in theme.h. Signed-off-by: Camila --- src/libsync/theme.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libsync/theme.h b/src/libsync/theme.h index 7dcdb55bf0d56..4e12c24cc1e2e 100644 --- a/src/libsync/theme.h +++ b/src/libsync/theme.h @@ -42,7 +42,6 @@ class OWNCLOUDSYNC_EXPORT Theme : public QObject Q_PROPERTY(QString appName READ appName CONSTANT) Q_PROPERTY(QUrl stateOnlineImageSource READ stateOnlineImageSource CONSTANT) Q_PROPERTY(QUrl stateOfflineImageSource READ stateOfflineImageSource CONSTANT) - Q_PROPERTY(QUrl stateOnlineImageSource READ stateOnlineImageSource CONSTANT) Q_PROPERTY(QUrl statusOnlineImageSource READ statusOnlineImageSource CONSTANT) Q_PROPERTY(QUrl statusDoNotDisturbImageSource READ statusDoNotDisturbImageSource CONSTANT) Q_PROPERTY(QUrl statusAwayImageSource READ statusAwayImageSource CONSTANT) From 449fda16e1ce98bea18ff46b4e72372a0571b568 Mon Sep 17 00:00:00 2001 From: Camila Date: Tue, 8 Jun 2021 21:04:53 +0200 Subject: [PATCH 5/6] Fix QML Warning: ReferenceError: PopupMenu is not defined. Signed-off-by: Camila --- src/gui/tray/Window.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index d5afdef76af55..6bfe020fa06f0 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -404,7 +404,7 @@ Window { source: "qrc:///client/theme/white/caret-down.svg" sourceSize.width: Style.accountDropDownCaretSize sourceSize.height: Style.accountDropDownCaretSize - Accessible.role: PopupMenu + Accessible.role: Accessible.PopupMenu Accessible.name: qsTr("Account switcher and settings menu") } } From 7ddc4ca170e3b5b363ba60b16a31e4c49981d2a1 Mon Sep 17 00:00:00 2001 From: Camila Date: Mon, 14 Jun 2021 21:54:14 +0200 Subject: [PATCH 6/6] Remove extra RowLayout. Signed-off-by: Camila --- src/gui/tray/UserLine.qml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/gui/tray/UserLine.qml b/src/gui/tray/UserLine.qml index 8945b656dffc9..b45710f67bbcf 100644 --- a/src/gui/tray/UserLine.qml +++ b/src/gui/tray/UserLine.qml @@ -102,7 +102,6 @@ MenuItem { Layout.leftMargin: Style.accountLabelsSpacing Label { id: accountUser - Layout.alignment: Qt.AlignLeft | Qt.AlignBottom width: 128 text: name elide: Text.ElideRight @@ -110,34 +109,32 @@ MenuItem { font.pixelSize: Style.topLinePixelSize font.bold: true } - RowLayout { - id: userStatus + Row { visible: model.isConnected && model.serverHasUserStatus - spacing: Style.userStatusAnchorsMargin - Layout.alignment: Qt.AlignLeft | Qt.AlignTop + width: Style.currentAccountLabelWidth + Style.userStatusEmojiSize Label { id: emoji + height: Style.topLinePixelSize visible: model.statusEmoji !== "" - width: Style.userStatusEmojiSize text: statusEmoji + topPadding: -Style.accountLabelsSpacing } Label { id: message - Layout.alignment: Qt.AlignLeft | Qt.AlignBottom - Layout.leftMargin: Style.userStatusAnchorsMargin + height: Style.topLinePixelSize visible: model.statusMessage !== "" - width: Style.currentAccountLabelWidth text: statusMessage elide: Text.ElideRight color: "black" font.pixelSize: Style.subLinePixelSize + leftPadding: Style.accountLabelsSpacing } } Label { id: accountServer - Layout.alignment: Qt.AlignLeft | Qt.AlignBottom width: Style.currentAccountLabelWidth + height: Style.topLinePixelSize text: server elide: Text.ElideRight color: "black"