summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-02-27 22:09:35 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-02-27 22:09:35 +0800
commit62c3a610a7f04dcb162657c76129a6e079766932 (patch)
tree405991f7b52897c4a93aad01bd1c9de01465e033
parent9a8186bf8606adf54fc42e1eb047bdc9646d708f (diff)
Tabs are now implemented with GridView
-rw-r--r--HomeDefault.ui.qml51
1 files changed, 29 insertions, 22 deletions
diff --git a/HomeDefault.ui.qml b/HomeDefault.ui.qml
index 438cd8f..0a1d971 100644
--- a/HomeDefault.ui.qml
+++ b/HomeDefault.ui.qml
@@ -237,33 +237,40 @@ Flickable {
}
}
- TabBar {
- id: tabs
- currentIndex: tabsContent.currentIndex
- background: Rectangle{
- color: Qt.rgba(.0235, .416, .788, .1)
- radius: 10
- }
- horizontalPadding: 16
- verticalPadding: 10
+ property int currentIndex: 0
+
+ Rectangle {
+ color: Qt.rgba(.0235, .416, .788, .1)
+ radius: 10
+ implicitHeight: tabs.height + 20
Layout.fillWidth: true
Layout.bottomMargin: 25.6
- Repeater {
- model: ["Web Design", "Development",
- "Graphic Design",
- "Marketing", "Finance"]
+ GridView {
+ id: tabs
+ interactive: false
+ anchors {
+ left: parent.left
+ leftMargin: 16
+ right: parent.right
+ rightMargin: 16
+ verticalCenter: parent.verticalCenter
+ }
+ cellWidth: 132.906
+ cellHeight: 46.5
+ implicitHeight: width < 266 ? cellHeight * 5 : width < 399 ? cellHeight * 3 : width < 665 ? cellHeight * 2 : cellHeight
- TabButton {
+ model: ["Web Design", "Development", "Graphic Design", "Marketing", "Finance"]
+
+ delegate: Label {
text: modelData
- horizontalPadding: 16
- verticalPadding: 8
- width: Math.max(124,
- tabs.width / 5)
- anchors {
- rightMargin: 8
- bottomMargin: 8
- }
+ height: 38
+ topPadding: 8
+ leftPadding: 16
+ rightPadding: tabs.width < 532 ? 64 : 24
+ rightInset: tabs.width < 532 ? 48 : 8
+ bottomPadding: tabs.width < 532 ? 8 : 16
+ bottomInset: tabs.width < 532 ? 0 : 8
background: Rectangle {
color: "#066ac9"
radius: 5.2