controlcenter: re-corrected bind loop
This commit is contained in:
parent
21e715468e
commit
d184f8d673
1 changed files with 8 additions and 3 deletions
|
|
@ -87,6 +87,7 @@ Item {
|
|||
id: row
|
||||
|
||||
Pane {
|
||||
index: 0
|
||||
sourceComponent: Dash {
|
||||
visibilities: root.visibilities
|
||||
state: root.state
|
||||
|
|
@ -95,12 +96,14 @@ Item {
|
|||
}
|
||||
|
||||
Pane {
|
||||
index: 1
|
||||
sourceComponent: Media {
|
||||
visibilities: root.visibilities
|
||||
}
|
||||
}
|
||||
|
||||
Pane {
|
||||
index: 2
|
||||
sourceComponent: Performance {}
|
||||
}
|
||||
}
|
||||
|
|
@ -126,12 +129,14 @@ Item {
|
|||
}
|
||||
|
||||
component Pane: Loader {
|
||||
required property int index
|
||||
|
||||
Layout.alignment: Qt.AlignTop
|
||||
|
||||
Component.onCompleted: active = Qt.binding(() => {
|
||||
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);
|
||||
const current = view.currentIndex;
|
||||
// Activate current pane and adjacent panes for smooth scrolling
|
||||
return Math.abs(index - current) <= 1;
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue