HSplitView with state saving and default props
This commit is contained in:
parent
51c68cf998
commit
ff7393b7c3
17
src/qml/Base/HSwipeView.qml
Normal file
17
src/qml/Base/HSwipeView.qml
Normal file
|
@ -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) }
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user