From b80e3776a8c1e9a44ad56240c80dcd0d71146893 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 17:26:21 +0800 Subject: Rating stars --- Font-Awesome/svgs/regular/clock.svg | 1 + Font-Awesome/svgs/regular/star.svg | 1 + Font-Awesome/svgs/solid/star-half-stroke.svg | 1 + Font-Awesome/svgs/solid/star.svg | 1 + Font-Awesome/svgs/solid/table.svg | 1 + Home/Default.ui.qml | 9 +++++++++ Home/Default/Card.ui.qml | 21 ++++++++++++++++++++- HomeDefault.qrc | 5 +++++ 8 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 Font-Awesome/svgs/regular/clock.svg create mode 100644 Font-Awesome/svgs/regular/star.svg create mode 100644 Font-Awesome/svgs/solid/star-half-stroke.svg create mode 100644 Font-Awesome/svgs/solid/star.svg create mode 100644 Font-Awesome/svgs/solid/table.svg diff --git a/Font-Awesome/svgs/regular/clock.svg b/Font-Awesome/svgs/regular/clock.svg new file mode 100644 index 0000000..517ba23 --- /dev/null +++ b/Font-Awesome/svgs/regular/clock.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Font-Awesome/svgs/regular/star.svg b/Font-Awesome/svgs/regular/star.svg new file mode 100644 index 0000000..cbed1a7 --- /dev/null +++ b/Font-Awesome/svgs/regular/star.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Font-Awesome/svgs/solid/star-half-stroke.svg b/Font-Awesome/svgs/solid/star-half-stroke.svg new file mode 100644 index 0000000..8a0f3b6 --- /dev/null +++ b/Font-Awesome/svgs/solid/star-half-stroke.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Font-Awesome/svgs/solid/star.svg b/Font-Awesome/svgs/solid/star.svg new file mode 100644 index 0000000..dad42d1 --- /dev/null +++ b/Font-Awesome/svgs/solid/star.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Font-Awesome/svgs/solid/table.svg b/Font-Awesome/svgs/solid/table.svg new file mode 100644 index 0000000..0e7c91a --- /dev/null +++ b/Font-Awesome/svgs/solid/table.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Home/Default.ui.qml b/Home/Default.ui.qml index 2a9e223..19f3166 100644 --- a/Home/Default.ui.qml +++ b/Home/Default.ui.qml @@ -271,6 +271,7 @@ Flickable { levelBackgroundColor: "#1a6f42c1" title: "Sketch from A to Z: for app designer" truncated: "Proposal indulged no do sociable he throwing settling." + rate: 4.0 }, ListElement { image: "https://eduport.webestica.com/assets/images/courses/4by3/02.jpg" @@ -279,6 +280,7 @@ Flickable { levelBackgroundColor: "#1a0cbc87" title: "Graphic Design Masterclass" truncated: "Rooms oh fully taken by worse do Points afraid but may end Rooms" + rate: 4.5 }, ListElement { image: "https://eduport.webestica.com/assets/images/courses/4by3/03.jpg" @@ -287,6 +289,7 @@ Flickable { levelBackgroundColor: "#1a0cbc87" title: "Create a Design System in Figma" truncated: "Rooms oh fully taken by worse do. Points afraid but may end afraid but may end." + rate: 4.5 }, ListElement { image: "https://eduport.webestica.com/assets/images/courses/4by3/07.jpg" @@ -295,6 +298,7 @@ Flickable { levelBackgroundColor: "#1a0cbc87" title: "Deep Learning with React-Native" truncated: "Far advanced settling say finished raillery. Offered chiefly farther" + rate: 4.0 }, ListElement { image: "https://eduport.webestica.com/assets/images/courses/4by3/11.jpg" @@ -303,6 +307,7 @@ Flickable { levelBackgroundColor: "#1a6f42c1" title: "Build Responsive Websites with HTML" truncated: "Far advanced settling say finished raillery. Offered chiefly farther" + rate: 4.0 }, ListElement { image: "https://eduport.webestica.com/assets/images/courses/4by3/12.jpg" @@ -311,6 +316,7 @@ Flickable { levelBackgroundColor: "#1a0cbc87" title: "Build Websites with CSS" truncated: "Far advanced settling say finished raillery. Offered chiefly farther" + rate: 4.5 }, ListElement { image: "https://eduport.webestica.com/assets/images/courses/4by3/04.jpg" @@ -319,6 +325,7 @@ Flickable { levelBackgroundColor: "#1a6f42c1" title: "Learn Invision" truncated: "Arrived off she elderly beloved him Course regard to up he hardly." + rate: 3.5 }, ListElement { image: "https://eduport.webestica.com/assets/images/courses/4by3/09.jpg" @@ -327,6 +334,7 @@ Flickable { levelBackgroundColor: "#1a6f42c1" title: "JavaScript: Full Understanding" truncated: "Far advanced settling say finished raillery. Offered chiefly farther" + rate: 5.0 } ] } @@ -357,6 +365,7 @@ Flickable { : levelBackgroundColor titleText: title truncatedText: truncated + rating: rate } } } diff --git a/Home/Default/Card.ui.qml b/Home/Default/Card.ui.qml index c4b64bc..beb3c13 100644 --- a/Home/Default/Card.ui.qml +++ b/Home/Default/Card.ui.qml @@ -19,6 +19,7 @@ Item { property string titleText: "Build Responsive Websites with HTML" property alias titleArea: titleArea property string truncatedText: "Far advanced settling say finished raillery. Offered chiefly farther" + property real rating: 4.0 DropShadow { source: rectangle @@ -137,7 +138,25 @@ Item { } RowLayout { - id: listInline + Repeater { + model: 5 + Image { + source: (index + 1) / rating <= 1.0 + ? "../../Font-Awesome/svgs/solid/star.svg" + : (index + 1) / rating < 1.25 + ? "../../Font-Awesome/svgs/solid/star-half-stroke.svg" + : "../../Font-Awesome/svgs/regular/star.svg" + sourceSize { + width: 15 + height: 13 + } + ColorOverlay { + anchors.fill: parent + source: parent + color: "#f7c32e" + } + } + } } } diff --git a/HomeDefault.qrc b/HomeDefault.qrc index 8e0b067..376d39d 100644 --- a/HomeDefault.qrc +++ b/HomeDefault.qrc @@ -6,6 +6,11 @@ Font-Awesome/svgs/solid/heart.svg Bootstrap/icons/patch-check-fill.svg Home/Default/Counter.ui.qml + Font-Awesome/svgs/solid/star.svg + Font-Awesome/svgs/solid/star-half-stroke.svg + Font-Awesome/svgs/regular/star.svg + Font-Awesome/svgs/regular/clock.svg + Font-Awesome/svgs/solid/table.svg Home/Default/Card.ui.qml Home/Default.ui.qml -- cgit v1.2.3