summary refs log tree commit diff
path: root/resources/qml/components
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-12-06 23:38:39 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-12-06 23:38:39 +0100
commit868342ffc9743dec348d15624d39e818c39c8a2a (patch)
treed60ad97d4db03136a882d323afece9ac7626c9c6 /resources/qml/components
parentFix a few clang tidy warnings (diff)
downloadnheko-868342ffc9743dec348d15624d39e818c39c8a2a.tar.xz
Allow swiping between views in single page mode
Allows access to spaces on mobile for example
Diffstat (limited to 'resources/qml/components')
-rw-r--r--resources/qml/components/AdaptiveLayout.qml10
1 files changed, 4 insertions, 6 deletions
diff --git a/resources/qml/components/AdaptiveLayout.qml b/resources/qml/components/AdaptiveLayout.qml

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