moment/src/gui/Base/HSwipeView.qml
miruka 1038678a2f Refactor global shortcuts, simplify debug consoles
- Move out all shortcuts from their central file to the component they
  actually belong to

- Get rid of DebugConsoleLoader and the multiple consoles handling mess,
  have only one global console
2020-04-03 07:53:36 -04:00

36 lines
817 B
QML

// SPDX-License-Identifier: LGPL-3.0-or-later
import QtQuick 2.12
import QtQuick.Controls 2.12
import "../ShortcutBundles"
SwipeView {
id: swipeView
Component.onCompleted: if (! changed) {
setCurrentIndex(window.getState(this, "currentIndex", defaultIndex))
saveEnabled = true
}
onCurrentIndexChanged: if (saveEnabled) window.saveState(this)
property string saveName: ""
property var saveId: "ALL"
property var saveProperties: ["currentIndex"]
// Prevent onCurrentIndexChanged from running before Component.onCompleted
property bool saveEnabled: false
property int defaultIndex: 0
property bool changed: currentIndex !== defaultIndex
function reset() { setCurrentIndex(defaultIndex) }
TabShortcuts {
container: swipeView
}
}