added colorpicker

This commit is contained in:
2026-07-21 14:34:39 +03:00
parent 5392273794
commit 6644fd07c1
15 changed files with 257 additions and 62 deletions
+10 -8
View File
@@ -1,6 +1,7 @@
import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import "../components"
Dialog {
id: editorDialog
@@ -41,6 +42,7 @@ Dialog {
errorF.text = "Ошибка"
pendingF.text = "..."
colorF.text = "#7b007b"
colorPicker.hex = "#7b007b"
iconCombo.model = btnController.listIcons()
iconCombo.currentIndex = 0
typeCombo.currentIndex = 0
@@ -59,6 +61,7 @@ Dialog {
errorF.text = o.errorText
pendingF.text = o.pendingText || "..."
colorF.text = o.btnColor || "#7b007b"
colorPicker.hex = o.btnColor || "#7b007b"
iconCombo.model = btnController.listIcons()
var ip = o.iconPath || ""
var fname = ip
@@ -130,16 +133,15 @@ Dialog {
}
RowLayout {
Layout.fillWidth: true
Text { text: "Цвет:"; color: editorDialog.panelFg }
ColorPickerField {
id: colorPicker
label: "Цвет:"
onColorChanged: colorF.text = hex
}
// Hidden field keeps save handler unchanged.
TextField {
id: colorF
Layout.fillWidth: true
placeholderText: "#7b007b"
}
Rectangle {
width: 28; height: 28; radius: 14
color: colorF.text || "#7b007b"
border.color: "#80ffffff"; border.width: 1
visible: false
}
}