From 691a8b9bc3544e1b8f012570550914871528d733 Mon Sep 17 00:00:00 2001 From: Jonas Karlsson Date: Fri, 1 Mar 2024 14:20:16 +0100 Subject: Dice example: center text Fixes: QTBUG-121144 Change-Id: Ifa4735307bda97dd9e830af8acac6239358fb1e1 Reviewed-by: Nicholas Bennett --- examples/demos/dice/main.qml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/demos/dice/main.qml b/examples/demos/dice/main.qml index e18a6e4a2..1d84307f3 100644 --- a/examples/demos/dice/main.qml +++ b/examples/demos/dice/main.qml @@ -48,18 +48,18 @@ ApplicationWindow { Label { id: tapLabel - width: parent.width - 20 // so text does not touch screen edges - height: text.height - anchors { - centerIn: parent - } - text: qsTr("Tap, click or shake to throw dice") + anchors.fill: parent + padding: parent.width * 0.1 + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + fontSizeMode: Text.Fit font.bold: true + font.pixelSize: 64 + text: qsTr("Tap, click or shake to throw dice") + wrapMode: Text.NoWrap style: Text.Raised color: "white" minimumPixelSize: 10 - font.pixelSize: 32 - wrapMode: Text.WordWrap NumberAnimation on opacity { id: tapLabelAnimation running: false -- cgit v1.2.3