50 lines
951 B
QML
50 lines
951 B
QML
import QtQuick 2.0
|
|
import QtQuick.Controls 2.2
|
|
|
|
Item {
|
|
id: root
|
|
|
|
property string title: ""
|
|
property QtObject lights: undefined
|
|
|
|
Column {
|
|
width: root.width
|
|
|
|
spacing: 5
|
|
|
|
GradientButton {
|
|
width: root.width
|
|
height: 40
|
|
|
|
visible: Boolean(root.title)
|
|
radius: 5
|
|
|
|
Label {
|
|
text: root.title
|
|
anchors.centerIn: parent
|
|
}
|
|
}
|
|
|
|
Row {
|
|
id: buttonsRow
|
|
|
|
width: root.width
|
|
height: childrenRect.height
|
|
|
|
spacing: 5
|
|
|
|
Repeater {
|
|
model: root.lights
|
|
|
|
width: root.width
|
|
|
|
GradientButton {
|
|
width: (root.width - buttonsRow.spacing * (root.lights.count - 1)) / root.lights.count
|
|
height: width / 2
|
|
radius: 5
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|