diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2026-01-03 18:50:34 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2026-01-03 18:50:34 +1100 |
| commit | e47579c58dc95205369719383020d23e72edb47a (patch) | |
| tree | 24bef265aba59cc41b349995ec890c83a1e86fc9 /modules/dashboard | |
| parent | dash: more expressive shapes (diff) | |
| download | caelestia-shell-e47579c58dc95205369719383020d23e72edb47a.tar.gz caelestia-shell-e47579c58dc95205369719383020d23e72edb47a.tar.bz2 caelestia-shell-e47579c58dc95205369719383020d23e72edb47a.zip | |
dashboard: fix scrolling between panes
Diffstat (limited to 'modules/dashboard')
| -rw-r--r-- | modules/dashboard/Content.qml | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/modules/dashboard/Content.qml b/modules/dashboard/Content.qml index 650e974..7259c4f 100644 --- a/modules/dashboard/Content.qml +++ b/modules/dashboard/Content.qml @@ -87,7 +87,6 @@ Item { id: row Pane { - index: 0 sourceComponent: Dash { visibilities: root.visibilities state: root.state @@ -96,19 +95,16 @@ Item { } Pane { - index: 1 sourceComponent: Media { visibilities: root.visibilities } } Pane { - index: 2 sourceComponent: Performance {} } Pane { - index: 3 sourceComponent: Weather {} } } @@ -134,14 +130,12 @@ Item { } component Pane: Loader { - required property int index - Layout.alignment: Qt.AlignTop Component.onCompleted: active = Qt.binding(() => { - const current = view.currentIndex; - // Activate current pane and adjacent panes for smooth scrolling - return Math.abs(index - current) <= 1; + const vx = Math.floor(view.visibleArea.xPosition * view.contentWidth); + const vex = Math.floor(vx + view.visibleArea.widthRatio * view.contentWidth); + return (vx >= x && vx <= x + implicitWidth) || (vex >= x && vex <= x + implicitWidth); }) } } |