diff options
author | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-03-03 09:01:52 +0800 |
---|---|---|
committer | ꦌꦫꦶꦏ꧀ꦦꦿꦧꦮꦑꦩꦭ꧀ <erik@darapsa.co.id> | 2023-03-03 09:01:52 +0800 |
commit | 640d2ccc4a9caa9b2288277cec2a19e2fc3e7239 (patch) | |
tree | 92cce0ba84ee6cfbe130548f2413d5870dc954b7 | |
parent | 49691e08473db195890d0367e3dacf13f19388f6 (diff) |
This works without relying on custom property
that needs to be set upon component completion
-rw-r--r-- | HomeDefault.ui.qml | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/HomeDefault.ui.qml b/HomeDefault.ui.qml index 4f420d6..0f706cf 100644 --- a/HomeDefault.ui.qml +++ b/HomeDefault.ui.qml @@ -270,15 +270,17 @@ Flickable { StackLayout { currentIndex: tabs.currentIndex - property int currentCount: 8 - Layout.preferredHeight: width < 576 ? width * 1.3 - * currentCount - : width < 768 ? width / 2 * 1.3 - * (currentCount + currentCount % 2) / 2 - : width < 992 ? width / 3 * 1.3 - * (currentCount + (currentCount + 1) % 3) / 3 + Layout.preferredHeight: width < 576 + ? width * 1.3 + * tabsContent.itemAt(tabsContent.index).count + : width < 768 + ? width / 2 * 1.3 + * (tabsContent.itemAt(tabsContent.index).count + tabsContent.itemAt(tabsContent.index).count % 2) / 2 + : width < 992 + ? width / 3 * 1.3 + * (tabsContent.itemAt(tabsContent.index).count + (tabsContent.itemAt(tabsContent.index).count + 1) % 3) / 3 : width / 4 * 1.3 - * (currentCount + (currentCount + 2) % 4) / 4 + * (tabsContent.itemAt(tabsContent.index).count + (tabsContent.itemAt(tabsContent.index).count + 2) % 4) / 4 Repeater { id: tabsContent |