diff --git a/src/qml/Base/HSwipeView.qml b/src/qml/Base/HSwipeView.qml new file mode 100644 index 00000000..93b0dd88 --- /dev/null +++ b/src/qml/Base/HSwipeView.qml @@ -0,0 +1,17 @@ +import QtQuick.Controls 2.12 + +SwipeView { + currentIndex: window.getState(this, "currentIndex", defaultIndex) + onCurrentIndexChanged: window.saveState(this) + + + property string saveName: "" + property var saveId: "ALL" + property var saveProperties: ["currentIndex"] + + property int defaultIndex: 0 + property bool changed: currentIndex !== defaultIndex + + + function reset() { setCurrentIndex(defaultIndex) } +} diff --git a/src/qml/Chat/RoomPane/RoomPane.qml b/src/qml/Chat/RoomPane/RoomPane.qml index 3a2e9150..28e702a0 100644 --- a/src/qml/Chat/RoomPane/RoomPane.qml +++ b/src/qml/Chat/RoomPane/RoomPane.qml @@ -57,10 +57,13 @@ HDrawer { } } - SwipeView { + HSwipeView { id: swipeView + clip: true interactive: ! roomPane.collapsed - currentIndex: 4 // XXX + + saveName: "roomPaneView" + saveId: chat.roomId Layout.fillWidth: true Layout.fillHeight: true