From 3f78ad957f5b43d18b61277c6808091487b595ae 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, 27 Mar 2023 19:25:41 +0800 Subject: Favorite implementation --- Home/Default/Card.ui.qml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'Home/Default') diff --git a/Home/Default/Card.ui.qml b/Home/Default/Card.ui.qml index c1193e1..36e9239 100644 --- a/Home/Default/Card.ui.qml +++ b/Home/Default/Card.ui.qml @@ -16,6 +16,7 @@ Item { property string badgeText: "All level" property color badgeColor: "#ff6f42c1" property color badgeBackgroundColor: "#1a6f42c1" + property alias favorite: favorite property string titleText: "Build Responsive Websites with HTML" property alias titleArea: titleArea property string truncatedText: "Far advanced settling say finished raillery. Offered chiefly farther" @@ -100,12 +101,21 @@ Item { } } - Image { + Button { id: favorite - source: "../../Font-Awesome/svgs/solid/heart.svg" - sourceSize { - width: 15 - height: 15 + display: AbstractButton.IconOnly + padding: 0 + width: 15 + height: 15 + flat: true + checkable: true + icon { + source: checked + ? "../../Font-Awesome/svgs/solid/heart.svg" + : "../../Font-Awesome/svgs/regular/heart.svg" + color: checked + ? "#d6293e" + : "transparent" } anchors { right: parent.right -- cgit v1.2.3