8 import QtQuick.Layouts 1.15
9 import org.kde.kirigami 2.19 as Kirigami
14 property Kirigami.PageRow pageRow: parent.pageRow
16 readonly
property Item currentItem: mainLayout.children[pageRow.currentIndex] ||
null
19 contentWidth: mainLayout.width
21 boundsBehavior: Flickable.StopAtBounds
22 interactive: Kirigami.Settings.hasTransientTouchInput
26 Math.min(currentItem.x + currentItem.width/2 - root.width/2,
27 root.contentWidth - root.width))
36 readonly
property bool useLayers: pageRow.layers.depth > 1
37 model: useLayers ? pageRow.layers.depth - 1 : pageRow.depth
39 Layout.preferredWidth: delegateLayout.implicitWidth
40 Layout.fillHeight:
true
42 if (mainRepeater.useLayers) {
43 while (pageRow.layers.depth > modelData + 1) {
47 pageRow.currentIndex = modelData;
50 hoverEnabled: !Kirigami.Settings.tabletMode
52 color: Kirigami.Theme.highlightColor
55 opacity: mainRepeater.count > 1 && parent.containsMouse ? 0.1 : 0
61 readonly
property Item page: mainRepeater.useLayers ? pageRow.layers.get(modelData + 1) : pageRow.get(modelData)
65 visible: modelData > 0
66 Layout.alignment:
Qt.AlignVCenter
67 Layout.preferredHeight: Kirigami.Units.iconSizes.small
68 Layout.preferredWidth: Layout.preferredHeight
70 color: Kirigami.Theme.textColor
71 source: LayoutMirroring.enabled ?
"go-next-symbolic-rtl" :
"go-next-symbolic"
74 Layout.leftMargin: Kirigami.Units.largeSpacing
75 Layout.rightMargin: Kirigami.Units.largeSpacing
76 color: Kirigami.Theme.textColor
77 verticalAlignment: Text.AlignVCenter
79 text: delegateLayout.page ? delegateLayout.page.title :
""
80 opacity: modelData === pageRow.currentIndex ? 1 : 0.4
87 Behavior on contentX {
89 duration: Kirigami.Units.longDuration
90 easing.type: Easing.InOutQuad