From 2bd8d579e56c1373a4b8851d367ce80669b688a8 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: Thu, 30 Mar 2023 13:54:52 +0800 Subject: Header cart button --- Bootstrap/icons/cart3.svg | 3 +++ Eduport.qrc | 1 + Header.ui.qml | 45 +++++++++++++++++++++++++++++++++++++++++++++ imports/Eduport/Eduport.qml | 1 + 4 files changed, 50 insertions(+) create mode 100644 Bootstrap/icons/cart3.svg diff --git a/Bootstrap/icons/cart3.svg b/Bootstrap/icons/cart3.svg new file mode 100644 index 0000000..2187149 --- /dev/null +++ b/Bootstrap/icons/cart3.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Eduport.qrc b/Eduport.qrc index 61278a6..bbd82fa 100644 --- a/Eduport.qrc +++ b/Eduport.qrc @@ -11,6 +11,7 @@ Bootstrap/icons/power.svg Bootstrap/icons/sun.svg Bootstrap/icons/moon-stars.svg + Bootstrap/icons/cart3.svg Button/Sm.ui.qml Button/Btn.ui.qml Button/Primary.ui.qml diff --git a/Header.ui.qml b/Header.ui.qml index bf76de1..4cc507d 100644 --- a/Header.ui.qml +++ b/Header.ui.qml @@ -9,6 +9,7 @@ import "Label" as Lbl ToolBar { property alias logo: logo + property alias cart: cart property alias profile: profile property string imageSource: "https://eduport.webestica.com/assets/images/avatar/01.jpg" property alias menu: menu @@ -77,6 +78,50 @@ ToolBar { } } + ToolButton { + id: cart + padding: 0 + width: 40 + height: 40 + anchors { + right: profile.left + rightMargin: 12 + verticalCenter: parent.verticalCenter + } + layer { + enabled: true + effect: OpacityMask { + maskSource: Rectangle { + width: 40 + height: 40 + radius: 40 + } + } + } + contentItem: Item { + + Image { + anchors.centerIn: parent + source: "Bootstrap/icons/cart3.svg" + sourceSize.width: 18 + fillMode: Image.PreserveAspectFit + + ColorOverlay { + color: Eduport.bsGray900 + source: parent + anchors.fill: parent + } + } + } + background: Rectangle { + color: Eduport.bsLight + border { + color: Eduport.bsLight + width: 1 + } + } + } + ToolButton { id: profile padding: 0 diff --git a/imports/Eduport/Eduport.qml b/imports/Eduport/Eduport.qml index 85ff011..f9cfe9d 100644 --- a/imports/Eduport/Eduport.qml +++ b/imports/Eduport/Eduport.qml @@ -125,6 +125,7 @@ QtObject { property color bsGray600: mode ? "#c5c6cc" : "#747579" property color bsGray700: mode ? "#f3f1f1" : "#404448" property color bsGray800: mode ? "#f7f5f5" : "#24292d" + property color bsGray900: mode ? "#ffffff" : "#0b0f13" readonly property bool haveRoboto: Qt.platform.os === "android" || Qt.platform.os === "linux" -- cgit v1.2.3