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-07-12 14:25:57 +10:00
|
|
|
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-03-06 23:40:48 +11:00
|
|
|
readonly property alias buttonRepeater: buttonRepeater
|
|
|
|
readonly property alias swipeView: swipeView
|
|
|
|
|
|
|
|
|
2020-07-12 14:25:57 +10:00
|
|
|
defaultSize: buttonRepeater.count * buttonWidth
|
2020-07-14 17:00:10 +10:00
|
|
|
minimumSize: requireDefaultSize ? defaultSize : buttonWidth
|
|
|
|
|
2020-03-06 23:40:48 +11:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|