From c8ebc9f7f5643900e7b3e502ee7982adb9cbd56d 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, 13 Feb 2023 16:00:52 +0800 Subject: Interface for customising header actions --- CheckoutFlickable.ui.qml | 2 ++ ClassicDetailFlickable.ui.qml | 2 ++ DefaultHomeFlickable.ui.qml | 2 ++ HeaderToolBar.qml | 9 +++++++++ 4 files changed, 15 insertions(+) diff --git a/CheckoutFlickable.ui.qml b/CheckoutFlickable.ui.qml index 8f138f6..565b528 100644 --- a/CheckoutFlickable.ui.qml +++ b/CheckoutFlickable.ui.qml @@ -3,6 +3,7 @@ import QtQuick.Controls 2.15 import QtQuick.Layouts 1.15 Flickable { + property alias header: header property alias checkoutAlert: alert property alias checkoutLogin: login property alias checkoutName: name @@ -27,6 +28,7 @@ Flickable { } HeaderToolBar { + id: header Layout.fillWidth: true } diff --git a/ClassicDetailFlickable.ui.qml b/ClassicDetailFlickable.ui.qml index b2f8fe0..5ec7c5d 100644 --- a/ClassicDetailFlickable.ui.qml +++ b/ClassicDetailFlickable.ui.qml @@ -5,6 +5,7 @@ import QtGraphicalEffects 1.15 Flickable { id: flickable + property alias header: header property alias detailImage: image property alias detailPrice: price property alias detailOriginalPrice: originalPrice @@ -23,6 +24,7 @@ Flickable { } HeaderToolBar { + id: header Layout.fillWidth: true } diff --git a/DefaultHomeFlickable.ui.qml b/DefaultHomeFlickable.ui.qml index 0e5300f..8266ad5 100644 --- a/DefaultHomeFlickable.ui.qml +++ b/DefaultHomeFlickable.ui.qml @@ -3,6 +3,7 @@ import QtQuick.Controls 2.15 import QtQuick.Layouts 1.15 Flickable { + property alias header: header property alias counter: counter property alias popular: popular contentHeight: body.height @@ -16,6 +17,7 @@ Flickable { } HeaderToolBar { + id: header Layout.fillWidth: true } diff --git a/HeaderToolBar.qml b/HeaderToolBar.qml index 174668e..cd8189c 100644 --- a/HeaderToolBar.qml +++ b/HeaderToolBar.qml @@ -3,6 +3,11 @@ import QtQuick.Controls 2.15 import QtQuick.Layouts 1.15 ToolBar { + property alias optionsMenu: optionsMenu + property alias optionProfile: profile + property alias optionSettings: settings + property alias optionHelp: help + property alias optionSign: sign property bool doesntEmbed: Qt.platform.os == "android" || Qt.platform.os == "linux" || Qt.platform.os == "osx" @@ -26,15 +31,19 @@ ToolBar { id: optionsMenu y: parent.height Action { + id: profile text: qsTr("Edit Profile") } Action { + id: settings text: qsTr("Account Settings") } Action { + id: help text: qsTr("Help") } Action { + id: sign text: qsTr("Sign Out") } delegate: MenuItem { -- cgit v1.2.3