LedDisplay/OmobiDisplayApp/ressources/qml/DisplayTextModelListView.qml
Dorian Zedler ce6d436c85
- finished implementing protocol
- added Initializing and Loading states
- added color picker
2020-10-14 23:54:12 +02:00

78 lines
1.7 KiB
QML

import QtQuick 2.4
import QtQuick.Controls 2.9
import QtQuick.Layouts 1.9
import QtQuick.Controls.Material 2.0
import de.itsblue.omobidisplayapp 1.0
ListView {
id: control
model: backend.displayTextModel
add: Transition {
NumberAnimation { property: "opacity"; from: 0; to: 1; duration: 200 }
NumberAnimation { property: "scale"; from: 0.9; to: 1; duration: 200 }
}
remove: Transition {
NumberAnimation { property: "opacity"; from: 1; to: 0; duration: 200 }
NumberAnimation { property: "scale"; from: 1; to: 0.9; duration: 200 }
}
spacing: 5
delegate: DisplayTextDelegate {
id: delegate
width: control.width
onClicked: {
popup.edit(model)
}
}
RoundButton {
anchors {
bottom: parent.bottom
horizontalCenter: parent.horizontalCenter
bottomMargin: height * 0.25
}
height: implicitHeight * 1.3
width: height
enabled: control.model.rowCount < control.model.maximumTextSets
Material.background: Material.accent
text: ""
onClicked: popup.add(control.model)
Text {
anchors.fill: parent
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
font.pixelSize: height * 0.4
color: "white"
text: "+"
}
}
TextEditDialog {
id: popup
Material.theme: control.Material.theme
Material.accent: control.Material.accent
onDiscarded: {
control.model.remove(editingModel.index)
popup.close()
}
}
}