Fix QML warning: Detected anchors on an item that is managed by a layout.

Signed-off-by: Camila <hello@camila.codes>
This commit is contained in:
Camila 2021-05-25 21:12:41 +02:00 committed by Matthieu Gallien (Rebase PR Action)
parent c8edb11228
commit 5585f61cc0
2 changed files with 23 additions and 19 deletions

View file

@ -354,10 +354,9 @@ Window {
Column { Column {
id: accountLabels id: accountLabels
spacing: Style.userStatusSpacing spacing: Style.userStatusSpacing
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft | Qt.AlignTop
Layout.leftMargin: Style.userStatusSpacing Layout.leftMargin: Style.userStatusSpacing
anchors.top: currentAccountAvatar.top Layout.topMargin: Style.accountLabelsLayoutTopMargin
anchors.topMargin: Style.userStatusSpacing
Label { Label {
id: currentAccountUser id: currentAccountUser
width: Style.currentAccountLabelWidth width: Style.currentAccountLabelWidth
@ -419,6 +418,7 @@ Window {
spacing: 0 spacing: 0
Layout.preferredWidth: Style.trayWindowHeaderHeight Layout.preferredWidth: Style.trayWindowHeaderHeight
Layout.preferredHeight: Style.trayWindowHeaderHeight Layout.preferredHeight: Style.trayWindowHeaderHeight
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
HeaderButton { HeaderButton {
id: openLocalFolderButton id: openLocalFolderButton
@ -436,25 +436,28 @@ Window {
radius: width*0.5 radius: width*0.5
z: 1 z: 1
} }
}
Image { Image {
id: folderStateIndicator id: folderStateIndicator
visible: UserModel.currentUser.hasLocalFolder visible: UserModel.currentUser.hasLocalFolder
source: UserModel.currentUser.isConnected source: UserModel.currentUser.isConnected
? Style.stateOnlineImageSource ? Style.stateOnlineImageSource
: Style.stateOfflineImageSource : Style.stateOfflineImageSource
cache: false cache: false
anchors.top: openLocalFolderButton.verticalCenter
anchors.left: openLocalFolderButton.horizontalCenter
sourceSize.width: Style.folderStateIndicatorSize anchors.top: openLocalFolderButton.verticalCenter
sourceSize.height: Style.folderStateIndicatorSize anchors.left: openLocalFolderButton.horizontalCenter
sourceSize.width: Style.folderStateIndicatorSize
sourceSize.height: Style.folderStateIndicatorSize
Accessible.role: Accessible.Indicator Accessible.role: Accessible.Indicator
Accessible.name: UserModel.currentUser.isConnected ? qsTr("Connected") : qsTr("Disconnected") Accessible.name: UserModel.currentUser.isConnected ? qsTr("Connected") : qsTr("Disconnected")
z: 2
}
} }
Accessible.role: Accessible.Button Accessible.role: Accessible.Button
Accessible.name: qsTr("Open local folder of current account") Accessible.name: qsTr("Open local folder of current account")
} }

View file

@ -52,6 +52,7 @@ QtObject {
property int accountLabelsSpacing: 4 property int accountLabelsSpacing: 4
property int accountLabelsAnchorsMargin: 7 property int accountLabelsAnchorsMargin: 7
property int accountLabelsLayoutMargin: 9 property int accountLabelsLayoutMargin: 9
property int accountLabelsLayoutTopMargin: 12
// Visual behaviour // Visual behaviour
property bool hoverEffectsEnabled: true property bool hoverEffectsEnabled: true