diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-02-25 17:52:32 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-02-25 17:52:32 +0800 |
commit | 3c32b0b56902f62569e4074f6a69301c57a69f94 (patch) | |
tree | b85202f23611d55981812d3621df5f4cdf96989c | |
parent | c33b970adbb2e528857bfe103f8d1f37a2469392 (diff) |
Make the counter content centered
-rw-r--r-- | Counter.ui.qml | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/Counter.ui.qml b/Counter.ui.qml index 86cff16..f75b2ce 100644 --- a/Counter.ui.qml +++ b/Counter.ui.qml @@ -7,33 +7,35 @@ Item { color: bgColor radius: 8 anchors { - top: parent.top + fill: parent topMargin: 25.6 - left: parent.left leftMargin: 12.8 - right: parent.right rightMargin: 12.8 - bottom: parent.bottom } - RowLayout { + Item { anchors { - top: parent.top - topMargin: 25.6 - left: parent.left - leftMargin: 25.6 - right: parent.right - rightMargin: 25.6 - bottom: parent.bottom - bottomMargin: 25.6 + fill: parent + margins: 25.6 } Image { + id: image source: icon - sourceSize.height: parent.height + sourceSize.height: column.height * 3 / 4 + fillMode: Image.PreserveAspectFit + x: (parent.width - (width + column.width + 25.6)) / 2 + anchors.verticalCenter: parent.verticalCenter } ColumnLayout { + id: column + spacing: 0 + anchors { + left: image.right + leftMargin: 25.6 + } + FontLoader { id: bold source: "Heebo/Heebo-Bold.ttf" @@ -43,21 +45,25 @@ Item { text: count font { family: bold.name - pixelSize: 21 + pointSize: 20.1 + weight: Font.Bold } + Layout.fillWidth: true } FontLoader { id: medium - source: "Heebo/Heebo-Bold.ttf" + source: "Heebo/Heebo-Medium.ttf" } Label { text: title font { family: medium.name - pixelSize: 15 + pointSize: 15 + weight: Font.Medium } + Layout.fillWidth: true } } } |