Warning, /libraries/kirigami-addons/src/dateandtime/private/DatePathView.qml is written in an unsupported language. File is not indexed.

0001 // SPDX-FileCopyrightText: 2021 Claudio Cambra <claudio.cambra@gmail.com>
0002 // SPDX-FileCopyrightText: 2023 Carl Schwan <carl@carlschwan.eu>
0003 // SPDX-License-Identifier: LGPL-2.1-or-later
0004 
0005 import QtQuick 2.15
0006 import QtQuick.Controls 2.15 as QQC2
0007 import QtQuick.Layouts 1.15
0008 import org.kde.kirigami 2.15 as Kirigami
0009 
0010 PathView {
0011     id: root
0012 
0013     required property QQC2.SwipeView mainView
0014     property int startIndex: 0
0015 
0016     implicitHeight: Kirigami.Units.gridUnit * 16
0017     flickDeceleration: 200
0018     highlightRangeMode: PathView.StrictlyEnforceRange
0019     preferredHighlightBegin: 0.5
0020     preferredHighlightEnd: 0.5
0021     snapMode: PathView.SnapToItem
0022     focus: true
0023 
0024     clip: true
0025 
0026     path: Path {
0027         startX: root.width / 2
0028         startY: -root.height * root.count / 2 + root.height / 2
0029         PathLine {
0030             x: root.width / 2
0031             y: root.height * root.count / 2 + root.height / 2
0032         }
0033     }
0034 
0035     // Center index
0036     Component.onCompleted: {
0037         startIndex = count / 2;
0038         currentIndex = startIndex;
0039     }
0040 }