summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-03-23 09:52:23 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-03-23 09:52:23 +0800
commit9a8c9b16fddd96ec2705f64d7023aedcde71d6e5 (patch)
tree40e2bd47d4d75752354beb9a1c6a808c2b4da194
parent265cb64a4f34298e450b7ea20450434a7762bf7a (diff)
Auth & Shop reuse custom TextField
-rw-r--r--Authentication/SignIn.ui.qml21
-rw-r--r--Authentication/SignUp.ui.qml31
-rw-r--r--Eduport.qrc1
-rw-r--r--Shop/Checkout.ui.qml60
-rw-r--r--TextField/Input.ui.qml15
5 files changed, 33 insertions, 95 deletions
diff --git a/Authentication/SignIn.ui.qml b/Authentication/SignIn.ui.qml
index cb634a1..f36f61d 100644
--- a/Authentication/SignIn.ui.qml
+++ b/Authentication/SignIn.ui.qml
@@ -4,6 +4,7 @@ import QtQuick.Layouts 1.15
import Bootstrap 5.3
import Eduport 1.4
import "../Label" as Lbl
+import "../TextField" as TxtFld
import "../Button" as BsBtn
Flickable {
@@ -74,19 +75,11 @@ Flickable {
Layout.margins: 16
}
- TextField {
+ TxtFld.Input {
id: email
placeholderText: qsTr("E-mail")
- font {
- family: Bootstrap.bodyFont.family
- weight: Bootstrap.bodyFont.weight
- pointSize: Eduport.formControlFontSize
- }
Layout.fillWidth: true
Layout.fillHeight: true
- background: Rectangle {
- color: "transparent"
- }
}
}
}
@@ -114,20 +107,12 @@ Flickable {
Layout.margins: 16
}
- TextField {
+ TxtFld.Input {
id: password
placeholderText: qsTr("password")
echoMode: TextInput.Password
- font {
- family: Bootstrap.bodyFont.family
- weight: Bootstrap.bodyFont.weight
- pointSize: Eduport.formControlFontSize
- }
Layout.fillWidth: true
Layout.fillHeight: true
- background: Rectangle {
- color: "transparent"
- }
}
}
}
diff --git a/Authentication/SignUp.ui.qml b/Authentication/SignUp.ui.qml
index 8367fbf..683ee7b 100644
--- a/Authentication/SignUp.ui.qml
+++ b/Authentication/SignUp.ui.qml
@@ -4,6 +4,7 @@ import QtQuick.Layouts 1.15
import Bootstrap 5.3
import Eduport 1.4
import "../Label" as Lbl
+import "../TextField" as TxtFld
import "../Button" as BsBtn
Flickable {
@@ -77,19 +78,11 @@ Flickable {
Layout.margins: 16
}
- TextField {
+ TxtFld.Input {
id: email
placeholderText: qsTr("E-mail")
- font {
- family: Bootstrap.bodyFont.family
- weight: Bootstrap.bodyFont.weight
- pointSize: Eduport.formControlFontSize
- }
Layout.fillWidth: true
Layout.fillHeight: true
- background: Rectangle {
- color: "transparent"
- }
}
}
}
@@ -118,20 +111,12 @@ Flickable {
Layout.margins: 16
}
- TextField {
+ TxtFld.Input {
id: password
placeholderText: "*********"
echoMode: TextInput.Password
- font {
- family: Bootstrap.bodyFont.family
- weight: Bootstrap.bodyFont.weight
- pointSize: Eduport.formControlFontSize
- }
Layout.fillWidth: true
Layout.fillHeight: true
- background: Rectangle {
- color: "transparent"
- }
}
}
}
@@ -160,20 +145,12 @@ Flickable {
Layout.margins: 16
}
- TextField {
+ TxtFld.Input {
id: confirmPassword
placeholderText: "*********"
echoMode: TextInput.Password
- font {
- family: Bootstrap.bodyFont.family
- weight: Bootstrap.bodyFont.weight
- pointSize: Eduport.formControlFontSize
- }
Layout.fillWidth: true
Layout.fillHeight: true
- background: Rectangle {
- color: "transparent"
- }
}
}
}
diff --git a/Eduport.qrc b/Eduport.qrc
index 984d8db..007b787 100644
--- a/Eduport.qrc
+++ b/Eduport.qrc
@@ -9,6 +9,7 @@
<file>imports/Eduport/qmldir</file>
<file>Label/Hx.ui.qml</file>
<file>Label/Body.ui.qml</file>
+ <file>TextField/Input.ui.qml</file>
<file>Button/Primary.ui.qml</file>
</qresource>
</RCC>
diff --git a/Shop/Checkout.ui.qml b/Shop/Checkout.ui.qml
index 6768217..97125c5 100644
--- a/Shop/Checkout.ui.qml
+++ b/Shop/Checkout.ui.qml
@@ -3,6 +3,7 @@ import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import Bootstrap 5.3
import Eduport 1.4
+import "../TextField" as TxtFld
import "../Label" as Lbl
Flickable {
@@ -110,16 +111,11 @@ Flickable {
Layout.fillWidth: true
RowLayout {
anchors.fill: parent
- TextField {
+ TxtFld.Input {
id: name
placeholderText: qsTr("Name")
- font.pointSize: 16
- font.family: "roboto"
Layout.fillWidth: true
Layout.fillHeight: true
- background: Rectangle {
- color: "transparent"
- }
}
}
}
@@ -140,16 +136,11 @@ Flickable {
Layout.fillWidth: true
RowLayout {
anchors.fill: parent
- TextField {
+ TxtFld.Input {
id: email
placeholderText: qsTr("Email")
- font.pointSize: 16
- font.family: "roboto"
Layout.fillWidth: true
Layout.fillHeight: true
- background: Rectangle {
- color: "transparent"
- }
}
}
}
@@ -170,16 +161,11 @@ Flickable {
Layout.fillWidth: true
RowLayout {
anchors.fill: parent
- TextField {
+ TxtFld.Input {
id: mobile
placeholderText: qsTr("Mobile number")
- font.pointSize: 16
- font.family: "roboto"
Layout.fillWidth: true
Layout.fillHeight: true
- background: Rectangle {
- color: "transparent"
- }
}
}
}
@@ -199,16 +185,11 @@ Flickable {
Layout.fillWidth: true
RowLayout {
anchors.fill: parent
- TextField {
+ TxtFld.Input {
id: country
placeholderText: qsTr("Select country")
- font.pointSize: 16
- font.family: "roboto"
Layout.fillWidth: true
Layout.fillHeight: true
- background: Rectangle {
- color: "transparent"
- }
}
}
}
@@ -229,17 +210,11 @@ Flickable {
Layout.fillWidth: true
RowLayout {
anchors.fill: parent
- TextField {
+ TxtFld.Input {
id: province
- placeholderText: qsTr(
- "Select state")
- font.pointSize: 16
- font.family: "roboto"
+ placeholderText: qsTr("Select state")
Layout.fillWidth: true
Layout.fillHeight: true
- background: Rectangle {
- color: "transparent"
- }
}
}
}
@@ -260,16 +235,11 @@ Flickable {
Layout.fillWidth: true
RowLayout {
anchors.fill: parent
- TextField {
+ TxtFld.Input {
id: postal
placeholderText: qsTr("PIN code")
- font.pointSize: 16
- font.family: "roboto"
Layout.fillWidth: true
Layout.fillHeight: true
- background: Rectangle {
- color: "transparent"
- }
}
}
}
@@ -290,16 +260,11 @@ Flickable {
Layout.fillWidth: true
RowLayout {
anchors.fill: parent
- TextField {
+ TxtFld.Input {
id: address
placeholderText: qsTr("Address")
- font.pointSize: 16
- font.family: "roboto"
Layout.fillWidth: true
Layout.fillHeight: true
- background: Rectangle {
- color: "transparent"
- }
}
}
}
@@ -490,15 +455,10 @@ Flickable {
Layout.fillWidth: true
RowLayout {
anchors.fill: parent
- TextField {
+ TxtFld.Input {
placeholderText: qsTr("COUPON CODE")
- font.pointSize: 16
- font.family: "roboto"
Layout.fillWidth: true
Layout.fillHeight: true
- background: Rectangle {
- color: "transparent"
- }
}
}
}
diff --git a/TextField/Input.ui.qml b/TextField/Input.ui.qml
new file mode 100644
index 0000000..a161582
--- /dev/null
+++ b/TextField/Input.ui.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+import Bootstrap 5.3
+import Eduport 1.4
+
+TextField {
+ font {
+ family: Bootstrap.bodyFont.family
+ weight: Bootstrap.bodyFont.weight
+ pointSize: Eduport.formControlFontSize
+ }
+ background: Rectangle {
+ color: "transparent"
+ }
+}