added colorpicker
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user