From db7d0d21e4c8c2b2a914c279e4efc34d4e1d3db0 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 19:41:53 +0800 Subject: Separate cart item to its own file --- Eduport.qrc | 1 + Header.ui.qml | 76 ++------------------------------------------------ Header/CartItem.ui.qml | 72 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 74 deletions(-) create mode 100644 Header/CartItem.ui.qml diff --git a/Eduport.qrc b/Eduport.qrc index ae1d1c7..70ba3ed 100644 --- a/Eduport.qrc +++ b/Eduport.qrc @@ -32,6 +32,7 @@ Label/H1.ui.qml Label/Display6.ui.qml TextField/Input.ui.qml + Header/CartItem.ui.qml Header.ui.qml diff --git a/Header.ui.qml b/Header.ui.qml index f2c61eb..29091b6 100644 --- a/Header.ui.qml +++ b/Header.ui.qml @@ -6,6 +6,7 @@ import Eduport 1.4 import "DropShadow" as DrpShdw import "Button" as Btn import "Label" as Lbl +import "Header" ToolBar { property alias logo: logo @@ -133,80 +134,7 @@ ToolBar { width: 256 sourceComponent: background } - delegate: MenuItem { - id: cartMenuItem - contentItem: ColumnLayout { - - Loader { - Layout.fillWidth: true - Layout.topMargin: -24 - Layout.leftMargin: -8 - Layout.rightMargin: -8 - sourceComponent: menuSeparator - } - - RowLayout { - Layout.margins: 16 - - Loader { - property string - imageSource: - cartMenuItem - .icon.source - property int - imageWidth: 50 - property int - imageHeight: 50 - property real - maskRadius: 5.2 - sourceComponent: image - Layout.alignment: - Qt.AlignTop - } - - ColumnLayout { - - RowLayout { - - Lbl.H6 { - text: - cartMenuItem - .text - Layout - .fillWidth: - true - } - - Button { - Layout.alignment: Qt.AlignTop - contentItem: Image { - source: "Bootstrap/icons/x.svg" - - ColorOverlay { - color: Eduport.bsGray600 - source: parent - anchors.fill: parent - } - } - background: Rectangle { - color: "transparent" - implicitWidth: 13 - } - } - } - - ComboBox { - model: [1, 2, - 3, 4, - 5] - } - } - } - } - background: Rectangle { - color: "transparent" - } - } + delegate: CartItem {} Lbl.H5 { text: qsTr("Cart items") diff --git a/Header/CartItem.ui.qml b/Header/CartItem.ui.qml new file mode 100644 index 0000000..2fbf03b --- /dev/null +++ b/Header/CartItem.ui.qml @@ -0,0 +1,72 @@ +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Layouts 1.15 +import QtGraphicalEffects 1.15 +import Eduport 1.4 +import "../Label" as Lbl + +MenuItem { + id: cartMenuItem + contentItem: ColumnLayout { + + Loader { + Layout.fillWidth: true + Layout.topMargin: -24 + Layout.leftMargin: -8 + Layout.rightMargin: -8 + sourceComponent: menuSeparator + } + + RowLayout { + Layout.margins: 16 + + Loader { + property string imageSource: cartMenuItem + .icon.source + property int imageWidth: 50 + property int imageHeight: 50 + property real maskRadius: 5.2 + sourceComponent: image + Layout.alignment: Qt.AlignTop + } + + ColumnLayout { + + RowLayout { + + Lbl.H6 { + text: cartMenuItem.text + Layout.fillWidth: true + } + + Button { + Layout.alignment: Qt.AlignTop + contentItem: Image { + source: + "../Bootstrap/icons/x.svg" + + ColorOverlay { + color: Eduport + .bsGray600 + source: parent + anchors.fill: + parent + } + } + background: Rectangle { + color: "transparent" + implicitWidth: 13 + } + } + } + + ComboBox { + model: [1, 2, 3, 4, 5] + } + } + } + } + background: Rectangle { + color: "transparent" + } +} -- cgit v1.2.3