8 import QtQuick.Layouts 1.12
9 import QtQuick.Controls 2.12 as QQC2
10 import org.kde.kirigami 2.14 as Kirigami
14 implicitWidth: bar.implicitWidth
15 QQC2.ScrollBar.horizontal.visible:
false
19 implicitHeight: bar.implicitHeight
20 implicitWidth: bar.implicitWidth
21 width: Math.max(view.width, bar.implicitWidth)
26 signal indexChanged(real xPos, real tabWidth)
28 anchors.centerIn: parent
29 width: Kirigami.Settings.isMobile && swipeNavigatorRoot.height > swipeNavigatorRoot.width ? parent.width : implicitWidth
30 property real targetDestination
33 target: view.QQC2.ScrollBar.horizontal
35 to: bar.targetDestination
36 duration: Kirigami.Units.longDuration
37 easing.type: Easing.OutExpo
39 onIndexChanged: (xPos, tabWidth) => {
40 if (xPos > (bar.width)/2) {
41 bar.targetDestination = (1-view.QQC2.ScrollBar.horizontal.size) * ((xPos+tabWidth) / bar.width)
44 bar.targetDestination = (1-view.QQC2.ScrollBar.horizontal.size) * ((xPos) / bar.width)
49 property Item layouter: Item {
53 model: swipeNavigatorRoot.pages
54 delegate: PrivateSwipeTab { vertical:
false }
60 model: swipeNavigatorRoot.pages
61 delegate: PrivateSwipeTab {
62 Layout.fillHeight:
true
63 Layout.fillWidth:
true
64 Layout.alignment:
Qt.AlignHCenter
65 vertical: Kirigami.Settings.isMobile
66 ? (swipeNavigatorRoot.width < swipeNavigatorRoot.height ? true : expandedLayouter.width > swipeNavigatorRoot.width)
67 : expandedLayouter.width > swipeNavigatorRoot.width
68 onIndexChanged: (xPos, tabWidth) => bar.indexChanged(xPos, tabWidth)