2020-10-14 23:54:12 +02:00
|
|
|
import QtQuick 2.0
|
|
|
|
import QtQuick.Controls 2.9
|
|
|
|
import QtQuick.Controls.Material 2.0
|
|
|
|
|
|
|
|
ItemDelegate {
|
|
|
|
id: control
|
|
|
|
|
|
|
|
property string value: ""
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
colorPicker.value = value
|
|
|
|
textEditDialog.open()
|
|
|
|
}
|
|
|
|
|
2020-10-15 12:52:19 +02:00
|
|
|
Chip {
|
2020-10-14 23:54:12 +02:00
|
|
|
anchors {
|
|
|
|
right: nextPageIconText.left
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
rightMargin: control.padding
|
|
|
|
}
|
|
|
|
|
|
|
|
width: parent.width * 0.15
|
|
|
|
height: parent.height * 0.6
|
|
|
|
|
|
|
|
color: control.value === "" ? "transparent":control.value
|
|
|
|
|
2020-10-15 12:52:19 +02:00
|
|
|
text: value === "" ? "Not set": value
|
2020-10-14 23:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: nextPageIconText
|
|
|
|
|
|
|
|
anchors {
|
|
|
|
right: parent.right
|
|
|
|
verticalCenter: parent.verticalCenter
|
|
|
|
rightMargin: control.padding
|
|
|
|
}
|
|
|
|
|
|
|
|
font.pixelSize: parent.height * 0.5
|
|
|
|
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
|
|
|
|
text: ">"
|
|
|
|
}
|
|
|
|
|
|
|
|
Dialog {
|
|
|
|
id: textEditDialog
|
|
|
|
parent: Overlay.overlay
|
|
|
|
|
|
|
|
x: (parent.width - width) / 2
|
|
|
|
y: (parent.height - height) / 2
|
|
|
|
|
|
|
|
width: parent.width * 0.9
|
2020-10-15 12:52:19 +02:00
|
|
|
height: Math.min(parent.height, contentHeight)
|
|
|
|
|
|
|
|
contentWidth: parent.width * 0.9 - leftInset - rightInset
|
|
|
|
contentHeight: contentWidth
|
2020-10-14 23:54:12 +02:00
|
|
|
|
|
|
|
Material.theme: control.Material.theme
|
|
|
|
Material.accent: control.Material.accent
|
|
|
|
modal: true
|
|
|
|
|
|
|
|
title: control.text
|
|
|
|
|
|
|
|
standardButtons: Dialog.Ok | Dialog.Cancel
|
|
|
|
|
|
|
|
contentItem: ColorPicker {
|
|
|
|
id: colorPicker
|
|
|
|
value: control.value
|
|
|
|
}
|
|
|
|
|
|
|
|
onAccepted: {
|
|
|
|
control.value = colorPicker.value
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|