From 60d9c266e2a4525f40ecb0cafea760c3e60ceb65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Mon, 6 Mar 2023 12:30:29 +0800 Subject: Customise badge background instead --- CardGrid.ui.qml | 45 +++++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 26 deletions(-) (limited to 'CardGrid.ui.qml') diff --git a/CardGrid.ui.qml b/CardGrid.ui.qml index cc280e2..4ec20f6 100644 --- a/CardGrid.ui.qml +++ b/CardGrid.ui.qml @@ -82,37 +82,30 @@ Item { Layout.fillWidth: true Layout.bottomMargin: 8 - Rectangle { + FontLoader { + id: roboto + source: doesntEmbed ? "" : "Roboto/Roboto-Regular.ttf" + } + + Label { id: badge - color: badgeBackgroundColor - implicitWidth: badgeLabel - .width + 18 - implicitHeight: badgeLabel - .height + 6 - radius: 6 anchors { left: parent.left - verticalCenter: parent - .verticalCenter + verticalCenter: parent.verticalCenter } - - FontLoader { - id: roboto - source: doesntEmbed ? "" - : "Roboto/Roboto-Regular.ttf" + topPadding: 4.463 + leftPadding: 8.287 + rightPadding: 8.287 + bottomPadding: 4.463 + text: badgeText + color: badgeColor + font { + family: doesntEmbed ? "Roboto" : roboto.name + pixelSize: 13 } - - Label { - id: badgeLabel - text: badgeText - color: badgeColor - font { - family: doesntEmbed - ? "Roboto" - : roboto.name - pixelSize: 13 - } - anchors.centerIn: parent + background: Rectangle { + color: badgeBackgroundColor + radius: 6 } } -- cgit v1.2.3