-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support wrap between 1st and last page in FullscreenFrame
支持首尾贯穿滚动 Log:
- Loading branch information
Showing
4 changed files
with
157 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. | ||
// | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
import QtQuick 2.15 | ||
import QtQml.Models 2.15 | ||
import QtQuick.Layouts 1.15 | ||
import QtQuick.Controls 2.15 | ||
|
||
Item { | ||
id: root | ||
|
||
width: 200 | ||
height: 200 | ||
|
||
required property DelegateModel model | ||
property alias currentIndex: view.currentIndex | ||
|
||
function incrementCurrentIndex() { view.incrementCurrentIndex() } | ||
function decrementCurrentIndex() { view.decrementCurrentIndex() } | ||
|
||
PathView { | ||
id: view | ||
|
||
anchors.fill: parent | ||
|
||
snapMode: PathView.SnapOneItem | ||
highlightRangeMode: PathView.StrictlyEnforceRange | ||
currentIndex: -1 | ||
pathItemCount: Math.min(3, root.model.count) | ||
|
||
model: root.model.model | ||
delegate: root.model.delegate | ||
|
||
path: Path { | ||
startX: -view.width / 2 | ||
startY: view.height / 2 | ||
|
||
PathLine { | ||
relativeX: view.width * view.pathItemCount | ||
relativeY: 0 | ||
} | ||
} | ||
} | ||
} |