From d844c5f70a9981585a25a44f9bb6f42a699c9054 Mon Sep 17 00:00:00 2001 From: Konstantinos Karmas Date: Mon, 20 Sep 2021 16:57:16 +0200 Subject: [PATCH] Fix alignment of the ApplicationSwitcher button The sign in button has a different size when you are logged in, where the account avatar was being drawn in the middle of the Sign In button. This was causing a weird alignment of the ApplicationSwitcher next to it, as it was adding an extra margin. This is now fixed by making sure that the width of the button that has to do with account adjusts according to whether you are logged in or not. This makes the ApplicationSwitcher icon move when you log in but looks more natural relatively to the account button. CURA-8421 --- resources/qml/Account/AccountWidget.qml | 8 ++++---- resources/qml/MainWindow/MainWindowHeader.qml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/qml/Account/AccountWidget.qml b/resources/qml/Account/AccountWidget.qml index ef1622daee..6433822497 100644 --- a/resources/qml/Account/AccountWidget.qml +++ b/resources/qml/Account/AccountWidget.qml @@ -12,8 +12,8 @@ Item property var profile: Cura.API.account.userProfile property var loggedIn: Cura.API.account.isLoggedIn - height: signInButton.height > accountWidget.height ? signInButton.height : accountWidget.height - width: signInButton.width > accountWidget.width ? signInButton.width : accountWidget.width + height: signInButton.visible ? signInButton.height : accountWidget.height + width: signInButton.visible ? signInButton.width : accountWidget.width Button { @@ -54,7 +54,7 @@ Item id: accountWidget anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: signInButton.horizontalCenter +// anchors.horizontalCenter: signInButton.horizontalCenter implicitHeight: Math.round(0.5 * UM.Theme.getSize("main_window_header").height) implicitWidth: Math.round(0.5 * UM.Theme.getSize("main_window_header").height) @@ -142,7 +142,7 @@ Item borderColor: UM.Theme.getColor("lining") borderWidth: UM.Theme.getSize("default_lining").width - target: Qt.point(width - (signInButton.width / 2), -10) + target: Qt.point(width - ((signInButton.visible ? signInButton.width : accountWidget.width) / 2), -10) arrowSize: UM.Theme.getSize("default_arrow").width } diff --git a/resources/qml/MainWindow/MainWindowHeader.qml b/resources/qml/MainWindow/MainWindowHeader.qml index 3e3e5da467..3302c916bb 100644 --- a/resources/qml/MainWindow/MainWindowHeader.qml +++ b/resources/qml/MainWindow/MainWindowHeader.qml @@ -146,7 +146,7 @@ Item { verticalCenter: parent.verticalCenter right: accountWidget.left -// rightMargin: UM.Theme.getSize("default_margin").width + rightMargin: UM.Theme.getSize("default_margin").width } }