summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-03-03 08:48:03 +0800
committerꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id>2023-03-03 08:48:03 +0800
commit49691e08473db195890d0367e3dacf13f19388f6 (patch)
treee032bf3d2cdb0d65cc21e6e9d0e2c7155864e90d
parent5510aea87db81510a8ff44683fb684f81198e7a9 (diff)
Tab item count info is in the content
-rw-r--r--HomeDefault.ui.qml33
-rw-r--r--TabItem.ui.qml2
2 files changed, 7 insertions, 28 deletions
diff --git a/HomeDefault.ui.qml b/HomeDefault.ui.qml
index 917102c..4f420d6 100644
--- a/HomeDefault.ui.qml
+++ b/HomeDefault.ui.qml
@@ -252,7 +252,6 @@ Flickable {
GridView {
id: tabs
- property int currentItemCount: 8
interactive: false
anchors {
left: parent.left
@@ -264,42 +263,22 @@ Flickable {
cellWidth: 142
cellHeight: 46
implicitHeight: width < 284 ? cellHeight * 5 : width < 426 ? cellHeight * 3 : width < 710 ? cellHeight * 2 : cellHeight
- model: ListModel {
- ListElement {
- label: "Web Design"
- count: 8
- }
- ListElement {
- label: "Development"
- count: 6
- }
- ListElement {
- label: "Graphic Design"
- count: 4
- }
- ListElement {
- label: "Marketing"
- count: 2
- }
- ListElement {
- label: "Finance"
- count: 2
- }
- }
+ model: ["Web Design", "Development", "Graphic Design", "Marketing", "Finance"]
delegate: TabItem {}
}
}
StackLayout {
currentIndex: tabs.currentIndex
+ property int currentCount: 8
Layout.preferredHeight: width < 576 ? width * 1.3
- * tabs.currentItemCount
+ * currentCount
: width < 768 ? width / 2 * 1.3
- * (tabs.currentItemCount + tabs.currentItemCount % 2) / 2
+ * (currentCount + currentCount % 2) / 2
: width < 992 ? width / 3 * 1.3
- * (tabs.currentItemCount + (tabs.currentItemCount + 1) % 3) / 3
+ * (currentCount + (currentCount + 1) % 3) / 3
: width / 4 * 1.3
- * (tabs.currentItemCount + (tabs.currentItemCount + 2) % 4) / 4
+ * (currentCount + (currentCount + 2) % 4) / 4
Repeater {
id: tabsContent
diff --git a/TabItem.ui.qml b/TabItem.ui.qml
index bf895d4..c44f1a3 100644
--- a/TabItem.ui.qml
+++ b/TabItem.ui.qml
@@ -18,7 +18,7 @@ Button {
height: 38
horizontalPadding: 16
verticalPadding: 8
- text: label
+ text: modelData
contentItem: Text {
text: button.text
color: index == currentIndex ? "white" : "#066ac9"