From 199d94cb7628e3d09138fbffd53134deadd94b2b Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Thu, 19 Mar 2026 08:30:52 +0000 Subject: [PATCH] =?UTF-8?q?fix(qml):=20center=20CButton=20text=20=E2=80=94?= =?UTF-8?q?=20wrap=20RowLayout=20in=20Item=20with=20anchors.centerIn?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- qml/components/core/CButton.qml | 46 ++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/qml/components/core/CButton.qml b/qml/components/core/CButton.qml index 181efbb83..de0c12f36 100644 --- a/qml/components/core/CButton.qml +++ b/qml/components/core/CButton.qml @@ -123,30 +123,34 @@ Button { } } - contentItem: RowLayout { - id: contentRow - spacing: 8 + contentItem: Item { + implicitWidth: contentRow.implicitWidth + implicitHeight: contentRow.implicitHeight - BusyIndicator { - Layout.preferredWidth: 16 - Layout.preferredHeight: 16 - running: control.loading - visible: control.loading - } + RowLayout { + id: contentRow + anchors.centerIn: parent + spacing: 8 - Text { - visible: control._effectiveIcon !== "" && !control.loading - text: control._effectiveIcon - font.pixelSize: control.font.pixelSize - color: control._foreground - } + BusyIndicator { + Layout.preferredWidth: 16 + Layout.preferredHeight: 16 + running: control.loading + visible: control.loading + } - Text { - text: control.text - font: control.font - color: control._foreground - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter + Text { + visible: control._effectiveIcon !== "" && !control.loading + text: control._effectiveIcon + font.pixelSize: control.font.pixelSize + color: control._foreground + } + + Text { + text: control.text + font: control.font + color: control._foreground + } } } }