From 40c2c1bbdb255feda8dce44bb6796657334fb7f8 Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Mon, 3 Feb 2025 16:32:42 +0100 Subject: [PATCH] QmlDesigner: Refresh user info in share dialog * Fetch user info when opening the share dialog to keep the shown data up to date * Add a small button to trigger an immediate refresh of the user info Task-number: QDS-14408 Change-Id: Idff4d8684963333a2e1997465325c10f5e69a6b1 Reviewed-by: Thomas Hartmann Reviewed-by: Burak Hancerli --- share/qtcreator/qmldesigner/toolbar/Main.qml | 45 +++++++++++++++++--- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/share/qtcreator/qmldesigner/toolbar/Main.qml b/share/qtcreator/qmldesigner/toolbar/Main.qml index b5f3145e192..574f6fd1d53 100644 --- a/share/qtcreator/qmldesigner/toolbar/Main.qml +++ b/share/qtcreator/qmldesigner/toolbar/Main.qml @@ -346,8 +346,8 @@ Rectangle { } onVisibleChanged: { - // if visible and logged in - // fetch user info + if (dvWindow.visible) + backend.designViewerConnector.fetchUserInfo() } onClosing: { @@ -547,9 +547,44 @@ Rectangle { anchors.verticalCenter: parent.verticalCenter spacing: 4 - Text { - color: StudioTheme.Values.themeTextColor - text: loggedInPage.email ?? "" + + RowLayout { + width: parent.width + + Text { + Layout.fillWidth: true + color: StudioTheme.Values.themeTextColor + text: loggedInPage.email ?? "" + } + + Label { + id: refresehIcon + width: 18 + height: 18 + color: StudioTheme.Values.themeTextColor + font.family: StudioTheme.Constants.iconFont.family + font.pixelSize: 14 + text: StudioTheme.Constants.updateContent_medium + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + scale: refresehMouseArea.containsMouse ? 1.2 : 1 + + RotationAnimation on rotation { + id: refresehAnimation + from: 0 + to: 360 + } + + MouseArea { + id: refresehMouseArea + anchors.fill: parent + hoverEnabled: true + onClicked: { + refresehAnimation.start() + backend.designViewerConnector.fetchUserInfo() + } + } + } } RowLayout {