making the activeHighlightBar follow the item in slideList

This commit is contained in:
Chris Cochrun 2023-01-17 14:50:26 -06:00
parent 7be875682f
commit 09a86af056

View file

@ -203,16 +203,20 @@ FocusScope {
Rectangle { Rectangle {
id: activeHighlightBar id: activeHighlightBar
width: previewSlidesList.currentItem.width - Kirigami.Units.smallSpacing * 2 width: Kirigami.Units.gridUnit * 10
height: Kirigami.Units.gridUnit / 4 height: Kirigami.Units.gridUnit / 4
y: previewSlidesList.y + Kirigami.Units.gridUnit * 6 y: previewSlidesList.y + Kirigami.Units.gridUnit * 6
x: previewSlidesList.currentItem.x + Kirigami.Units.smallSpacing x: {
let slideX = SlideObject.slideIndex === 0 ? previewSlidesList.currentItem.width : (SlideObject.slideIndex - 1) * previewSlidesList.currentItem.width
previewSlidesList.currentItem.x + Kirigami.Units.smallSpacing
}
radius: 5 radius: 5
color: Kirigami.Theme.negativeTextColor color: Kirigami.Theme.negativeTextColor
Behavior on x { PropertyAnimation { Behavior on x { PropertyAnimation {
properties: "x" properties: "x"
easing.type: Easing.InOutQuad; easing.type: Easing.InOutElastic;
easing.period: 1.5
duration: 150 duration: 150
}} }}
} }