|
|
@ -16,10 +16,12 @@ Container { |
|
|
|
|
|
|
|
|
|
|
|
property bool singlePageMode: width < 800 |
|
|
|
property bool singlePageMode: width < 800 |
|
|
|
property int splitterGrabMargin: Nheko.paddingSmall |
|
|
|
property int splitterGrabMargin: Nheko.paddingSmall |
|
|
|
property int pageIndex: 0 |
|
|
|
property alias pageIndex: view.currentIndex |
|
|
|
property Component handle |
|
|
|
property Component handle |
|
|
|
property Component handleToucharea |
|
|
|
property Component handleToucharea |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onSinglePageModeChanged: if (!singlePageMode) pageIndex = 0 |
|
|
|
|
|
|
|
|
|
|
|
anchors.fill: parent |
|
|
|
anchors.fill: parent |
|
|
|
Component.onCompleted: { |
|
|
|
Component.onCompleted: { |
|
|
|
for (var i = 0; i < count - 1; i++) { |
|
|
|
for (var i = 0; i < count - 1; i++) { |
|
|
@ -103,9 +105,7 @@ Container { |
|
|
|
xAxis.minimum: splitter.minimumWidth - 1 |
|
|
|
xAxis.minimum: splitter.minimumWidth - 1 |
|
|
|
xAxis.maximum: splitter.maximumWidth |
|
|
|
xAxis.maximum: splitter.maximumWidth |
|
|
|
margin: container.splitterGrabMargin |
|
|
|
margin: container.splitterGrabMargin |
|
|
|
//dragThreshold: 0 |
|
|
|
|
|
|
|
grabPermissions: PointerHandler.CanTakeOverFromAnything | PointerHandler.ApprovesTakeOverByHandlersOfSameType |
|
|
|
grabPermissions: PointerHandler.CanTakeOverFromAnything | PointerHandler.ApprovesTakeOverByHandlersOfSameType |
|
|
|
//cursorShape: Qt.SizeHorCursor |
|
|
|
|
|
|
|
onActiveChanged: { |
|
|
|
onActiveChanged: { |
|
|
|
if (!active) |
|
|
|
if (!active) |
|
|
|
splitter.parent.preferredWidth = splitter.x; |
|
|
|
splitter.parent.preferredWidth = splitter.x; |
|
|
@ -114,8 +114,6 @@ Container { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
HoverHandler { |
|
|
|
HoverHandler { |
|
|
|
//cursorShape: Qt.SizeHorCursor |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enabled: !container.singlePageMode |
|
|
|
enabled: !container.singlePageMode |
|
|
|
margin: container.splitterGrabMargin |
|
|
|
margin: container.splitterGrabMargin |
|
|
|
} |
|
|
|
} |
|
|
@ -129,7 +127,7 @@ Container { |
|
|
|
snapMode: ListView.SnapOneItem |
|
|
|
snapMode: ListView.SnapOneItem |
|
|
|
orientation: ListView.Horizontal |
|
|
|
orientation: ListView.Horizontal |
|
|
|
highlightRangeMode: ListView.StrictlyEnforceRange |
|
|
|
highlightRangeMode: ListView.StrictlyEnforceRange |
|
|
|
interactive: false |
|
|
|
interactive: singlePageMode |
|
|
|
highlightMoveDuration: container.singlePageMode ? 200 : 0 |
|
|
|
highlightMoveDuration: container.singlePageMode ? 200 : 0 |
|
|
|
currentIndex: container.singlePageMode ? container.pageIndex : 0 |
|
|
|
currentIndex: container.singlePageMode ? container.pageIndex : 0 |
|
|
|
} |
|
|
|
} |
|
|
|