adding a bar to track the active slide

This commit is contained in:
Chris Cochrun 2023-01-17 13:53:42 -06:00
parent bb2c58773e
commit 7d11fa86ba
2 changed files with 27 additions and 15 deletions

View file

@ -66,17 +66,6 @@ Item {
onClicked: changeSlideAndIndex(outerModelData, index)
cursorShape: Qt.PointingHandCursor
}
Rectangle {
id: activeHighlightBar
width: previewSlideItem.width
height: Kirigami.Units.gridUnit / 4
anchors.top: previewSlideItem.bottom
anchors.left: previewSlideItem.left
anchors.topMargin: Kirigami.Units.smallSpacing
color: Kirigami.Theme.negativeTextColor
visible: outerModelData.active && SlideObject.slideIndex == index - 1
}
}
}
}
@ -105,15 +94,17 @@ Item {
Connections {
target: serviceItemModel
onDataChanged: if (active)
previewSlidesList.positionViewAtIndex(index, ListView.Center)
previewSlidesList.positionViewAtIndex(index, ListView.Contain)
}
}
function changeSlideAndIndex(serviceItem, index) {
// TODO
console.log("Item: " + serviceItem.index + " is " + serviceItem.active);
if (!serviceItem.active)
if (!serviceItem.active) {
changeServiceItem(serviceItem.index)
previewSlidesList.currentIndex = serviceItem.index;
}
console.log("Slide Index is: " + index);
if (index === 0)
return;