From f19f208b3c74a395d8315ba1462c92cfcd73ebd8 Mon Sep 17 00:00:00 2001 From: Alexandra Betouni <31625338+alexandraB99@users.noreply.github.com> Date: Fri, 15 Jul 2022 17:09:58 +0300 Subject: [PATCH] fix(StatusBaseButton): centered button's content (#779) Closes #724 --- src/StatusQ/Controls/StatusBaseButton.qml | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/StatusQ/Controls/StatusBaseButton.qml b/src/StatusQ/Controls/StatusBaseButton.qml index 666f9431..29d48d9d 100644 --- a/src/StatusQ/Controls/StatusBaseButton.qml +++ b/src/StatusQ/Controls/StatusBaseButton.qml @@ -80,9 +80,9 @@ Rectangle { /// Implementation + implicitWidth: layout.width + statusBaseButton.leftPadding + statusBaseButton.rightPadding + implicitHeight: layout.height + statusBaseButton.topPadding + statusBaseButton.bottomPadding - implicitWidth: sensor.width - implicitHeight: sensor.height radius: size !== StatusBaseButton.Size.Tiny ? 8 : 6 @@ -100,9 +100,7 @@ Rectangle { MouseArea { id: sensor - width: layout.width + statusBaseButton.leftPadding + statusBaseButton.rightPadding - height: layout.height + statusBaseButton.topPadding + statusBaseButton.bottomPadding - + anchors.fill: parent cursorShape: loading ? Qt.ArrowCursor : Qt.PointingHandCursor @@ -110,8 +108,7 @@ Rectangle { enabled: !loading && statusBaseButton.enabled Loader { - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter + anchors.centerIn: parent active: loading sourceComponent: StatusLoadingIndicator { color: d.textColor @@ -120,9 +117,7 @@ Rectangle { Row { id: layout - anchors.left: parent.left - anchors.leftMargin: statusBaseButton.leftPadding - anchors.verticalCenter: parent.verticalCenter + anchors.centerIn: parent spacing: 4 StatusIcon { id: statusIcon