moment/src/gui/Base/MultiviewPane.qml

56 lines
1.3 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
default property alias swipeViewData: swipeView.contentData
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-09-04 00:49:15 +10:00
readonly property alias contentTranslation: contentTranslation
2020-03-06 23:40:48 +11:00
readonly property alias buttonRepeater: buttonRepeater
readonly property alias swipeView: swipeView
defaultSize: buttonRepeater.count * buttonWidth
minimumSize: buttonWidth
2020-03-06 23:40:48 +11:00
HColumnLayout {
anchors.fill: parent
2020-09-04 00:49:15 +10:00
transform: Translate { id: contentTranslation }
2020-03-06 23:40:48 +11:00
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
}
}
}