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: {
|
2020-10-15 13:16:46 +02:00
|
|
|
if(value === "")
|
|
|
|
colorPicker.value = "#FFFFFF"
|
|
|
|
else
|
2020-10-14 23:54:12 +02:00
|
|
|
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
|
|
|
|
|
2020-10-15 13:16:46 +02:00
|
|
|
color: control.value === "" ? "#FFFFFF":control.value
|
2020-10-14 23:54:12 +02:00
|
|
|
|
2020-10-15 12:52:19 +02:00
|
|
|
text: value === "" ? "Not set": value
|
2020-10-15 13:16:46 +02:00
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
control.clicked()
|
|
|
|
}
|
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
|
2020-10-17 21:51:33 +02:00
|
|
|
font.styleName: fontAwesome.name
|
2020-10-14 23:54:12 +02:00
|
|
|
|
|
|
|
verticalAlignment: Text.AlignVCenter
|
|
|
|
|
2020-10-17 21:51:33 +02:00
|
|
|
text: "\uf105"
|
2020-10-14 23:54:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|