From 684ad4e18dd4e0e9567a63a95694e9103a6454c8 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, 23 Mar 2023 12:52:14 +0800 Subject: Success button and its reuse --- Shop/Checkout.ui.qml | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'Shop') diff --git a/Shop/Checkout.ui.qml b/Shop/Checkout.ui.qml index 5358c46..0409590 100644 --- a/Shop/Checkout.ui.qml +++ b/Shop/Checkout.ui.qml @@ -5,6 +5,7 @@ import Bootstrap 5.3 import Eduport 1.4 import "../TextField" as TxtFld import "../Label" as Lbl +import "../Button" as Btn Flickable { property alias alert: alert @@ -591,23 +592,31 @@ Flickable { } } - Button { + Btn.Success { id: placeOrder Layout.margins: 16 Layout.fillWidth: true text: qsTr("Place Order") - font: Bootstrap.btnFont implicitHeight: 36 - contentItem: Text { - text: placeOrder.text - font: placeOrder.font - color: "#ffffff" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter + font { + family: Bootstrap.btnFont.family + weight: Bootstrap.btnFont.weight + pointSize: Bootstrap.btnLgFontSize } background: Rectangle { - color: "#0cbc87" - radius: 8 + color: placeOrder.down ? Bootstrap.btnSuccessActiveBG + : placeOrder.enabled + ? Bootstrap.btnSuccessBg + : Bootstrap.btnSuccessDisabledBg + border { + width: Bootstrap.btnBorderWidth + color: placeOrder.down + ? Bootstrap.btnSuccessActiveBorderColor + : placeOrder.enabled + ? Bootstrap.btnSuccessBorderColor + : Bootstrap.btnSuccessDisabledBorderColor + } + radius: Bootstrap.btnLgBorderRadius } } } -- cgit v1.2.3