2020-10-12 14:13:52 +02:00
|
|
|
import QtQuick 2.4
|
2020-10-11 21:01:21 +02:00
|
|
|
import QtQuick.Controls 2.9
|
2020-10-12 14:13:52 +02:00
|
|
|
import QtQuick.Layouts 1.9
|
2020-10-11 21:01:21 +02:00
|
|
|
import QtQuick.Controls.Material 2.0
|
|
|
|
|
2020-10-18 15:08:12 +02:00
|
|
|
import de.itsblue.LedDisplayController 1.0
|
2020-10-13 01:58:14 +02:00
|
|
|
|
2020-10-11 21:01:21 +02:00
|
|
|
ListView {
|
|
|
|
id: control
|
|
|
|
|
2020-10-15 12:52:19 +02:00
|
|
|
spacing: 5
|
|
|
|
|
|
|
|
boundsBehavior: Flickable.OvershootBounds
|
|
|
|
|
2020-10-13 01:58:14 +02:00
|
|
|
model: backend.displayTextModel
|
2020-10-11 21:01:21 +02:00
|
|
|
|
2020-10-13 01:58:14 +02:00
|
|
|
add: Transition {
|
|
|
|
NumberAnimation { property: "opacity"; from: 0; to: 1; duration: 200 }
|
|
|
|
NumberAnimation { property: "scale"; from: 0.9; to: 1; duration: 200 }
|
|
|
|
}
|
2020-10-11 21:01:21 +02:00
|
|
|
|
2020-10-13 01:58:14 +02:00
|
|
|
remove: Transition {
|
|
|
|
NumberAnimation { property: "opacity"; from: 1; to: 0; duration: 200 }
|
|
|
|
NumberAnimation { property: "scale"; from: 1; to: 0.9; duration: 200 }
|
|
|
|
}
|
|
|
|
|
2020-10-11 21:01:21 +02:00
|
|
|
delegate: DisplayTextDelegate {
|
|
|
|
id: delegate
|
2020-10-13 01:58:14 +02:00
|
|
|
|
2020-10-11 21:01:21 +02:00
|
|
|
width: control.width
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
popup.edit(model)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RoundButton {
|
|
|
|
anchors {
|
|
|
|
bottom: parent.bottom
|
|
|
|
horizontalCenter: parent.horizontalCenter
|
|
|
|
bottomMargin: height * 0.25
|
|
|
|
}
|
|
|
|
|
2020-10-13 01:58:14 +02:00
|
|
|
height: implicitHeight * 1.3
|
2020-10-11 21:01:21 +02:00
|
|
|
width: height
|
|
|
|
|
2020-10-14 23:54:12 +02:00
|
|
|
enabled: control.model.rowCount < control.model.maximumTextSets
|
|
|
|
|
2020-10-13 01:58:14 +02:00
|
|
|
Material.background: Material.accent
|
|
|
|
|
2020-10-11 21:01:21 +02:00
|
|
|
text: ""
|
|
|
|
|
2020-10-13 01:58:14 +02:00
|
|
|
onClicked: popup.add(control.model)
|
2020-10-11 21:01:21 +02:00
|
|
|
|
|
|
|
Text {
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
|
|
|
|
font.pixelSize: height * 0.4
|
|
|
|
|
2020-10-13 01:58:14 +02:00
|
|
|
color: "white"
|
|
|
|
|
2020-10-11 21:01:21 +02:00
|
|
|
text: "+"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-13 01:58:14 +02:00
|
|
|
TextEditDialog {
|
2020-10-11 21:01:21 +02:00
|
|
|
id: popup
|
|
|
|
|
2020-10-13 01:58:14 +02:00
|
|
|
Material.theme: control.Material.theme
|
|
|
|
Material.accent: control.Material.accent
|
2020-10-11 21:01:21 +02:00
|
|
|
|
2020-10-12 14:13:52 +02:00
|
|
|
onDiscarded: {
|
2020-10-13 01:58:14 +02:00
|
|
|
control.model.remove(editingModel.index)
|
2020-10-12 14:13:52 +02:00
|
|
|
popup.close()
|
|
|
|
}
|
2020-10-11 21:01:21 +02:00
|
|
|
}
|
|
|
|
}
|