dashboard on right, change trigger to clock

This commit is contained in:
Zacharias-Brohn
2026-02-14 12:22:10 +01:00
parent a645c28d4f
commit df1d877c8f
12 changed files with 99 additions and 87 deletions
+3 -34
View File
@@ -25,12 +25,12 @@ Item {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
anchors.margins: Appearance.padding.large
anchors.margins: Appearance.padding.smaller
radius: 8
radius: 6
color: "transparent"
Flickable {
Item {
id: view
readonly property int currentIndex: root.state.currentTab
@@ -38,36 +38,9 @@ Item {
anchors.fill: parent
flickableDirection: Flickable.HorizontalFlick
implicitWidth: currentItem.implicitWidth
implicitHeight: currentItem.implicitHeight
contentX: currentItem.x
contentWidth: row.implicitWidth
contentHeight: row.implicitHeight
onContentXChanged: {
if (!moving)
return;
const x = contentX - currentItem.x;
if (x > currentItem.implicitWidth / 2)
root.state.currentTab = Math.min(root.state.currentTab + 1, tabs.count - 1);
else if (x < -currentItem.implicitWidth / 2)
root.state.currentTab = Math.max(root.state.currentTab - 1, 0);
}
onDragEnded: {
const x = contentX - currentItem.x;
if (x > currentItem.implicitWidth / 10)
root.state.currentTab = Math.min(root.state.currentTab + 1, tabs.count - 1);
else if (x < -currentItem.implicitWidth / 10)
root.state.currentTab = Math.max(root.state.currentTab - 1, 0);
else
contentX = Qt.binding(() => currentItem.x);
}
RowLayout {
id: row
@@ -79,10 +52,6 @@ Item {
}
}
}
Behavior on contentX {
Anim {}
}
}
}