moment/src/gui/Base/MultiviewPane.qml

54 lines
1.2 KiB
QML
Raw Normal View History

2020-03-06 23:40:48 +11:00
// SPDX-License-Identifier: LGPL-3.0-or-later
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
HDrawer {
id: pane
2020-03-19 15:13:19 +11:00
defaultSize: buttonRepeater.count * buttonWidth
minimumSize: buttonWidth
2020-03-06 23:40:48 +11:00
property color buttonsBackgroundColor
2020-03-19 15:13:19 +11:00
property int buttonWidth:
buttonRepeater.count > 0 ? buttonRepeater.itemAt(0).implicitWidth : 0
2020-03-06 23:40:48 +11:00
readonly property alias buttonRepeater: buttonRepeater
readonly property alias swipeView: swipeView
default property alias swipeViewData: swipeView.contentData
HColumnLayout {
anchors.fill: parent
2020-03-13 16:09:04 +11:00
Rectangle {
color: buttonsBackgroundColor
2020-03-06 23:40:48 +11:00
Layout.fillWidth: true
2020-03-13 16:09:04 +11:00
Layout.preferredHeight: childrenRect.height
HFlow {
id: buttonFlow
width: parent.width
populate: null
2020-03-06 23:40:48 +11:00
2020-03-19 15:13:19 +11:00
Repeater {
2020-03-13 16:09:04 +11:00
id: buttonRepeater
}
2020-03-06 23:40:48 +11:00
}
}
HSwipeView {
id: swipeView
clip: true
interactive: ! pane.collapsed
Layout.fillWidth: true
Layout.fillHeight: true
}
}
}