2020-10-13 01:58:14 +02:00
|
|
|
import QtQuick 2.0
|
|
|
|
import QtQuick.Controls 2.9
|
|
|
|
import QtQuick.Controls.Material 2.0
|
|
|
|
|
|
|
|
ItemDelegate {
|
|
|
|
id: control
|
|
|
|
|
|
|
|
property string value: ""
|
|
|
|
property alias from: spinBox.from
|
|
|
|
property alias to: spinBox.to
|
2020-10-18 01:39:59 +02:00
|
|
|
property bool editable: false
|
2020-10-13 01:58:14 +02:00
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
spinBox.value = control.value
|
|
|
|
textEditDialog.open()
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
anchors {
|
|
|
|
right: nextPageIconText.left
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
rightMargin: control.padding
|
|
|
|
}
|
|
|
|
|
|
|
|
font.pixelSize: parent.font.pixelSize
|
|
|
|
|
|
|
|
color: control.Material.foreground
|
|
|
|
|
|
|
|
text: value === "" ? "Not set": value + ""
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: nextPageIconText
|
|
|
|
|
|
|
|
anchors {
|
|
|
|
right: parent.right
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
rightMargin: control.padding
|
|
|
|
}
|
|
|
|
|
|
|
|
font.pixelSize: parent.height * 0.5
|
2020-10-17 21:51:33 +02:00
|
|
|
font.styleName: fontAwesome.name
|
2020-10-13 01:58:14 +02:00
|
|
|
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
|
|
|
|
color: control.Material.foreground
|
|
|
|
|
2020-10-17 21:51:33 +02:00
|
|
|
text: "\uf105"
|
2020-10-13 01:58:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Dialog {
|
|
|
|
id: textEditDialog
|
|
|
|
parent: Overlay.overlay
|
|
|
|
|
|
|
|
x: (parent.width - width) / 2
|
|
|
|
y: (parent.height - height) / 2
|
|
|
|
|
|
|
|
width: parent.width * 0.9
|
|
|
|
|
|
|
|
Material.theme: control.Material.theme
|
|
|
|
Material.accent: control.Material.accent
|
|
|
|
modal: true
|
|
|
|
|
|
|
|
title: control.text
|
|
|
|
|
|
|
|
standardButtons: Dialog.Ok | Dialog.Cancel
|
|
|
|
|
|
|
|
contentItem: SpinBox {
|
|
|
|
id: spinBox
|
|
|
|
value: control.value
|
2020-10-18 01:39:59 +02:00
|
|
|
editable: control.editable
|
2020-10-13 01:58:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
onAccepted: {
|
|
|
|
control.value = spinBox.value
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|