added colorpicker
This commit is contained in:
@@ -7,6 +7,18 @@ import "../components"
|
||||
Item {
|
||||
id: page
|
||||
|
||||
function syncColors() {
|
||||
okPicker.hex = settingsContainer.feedbackOkColor
|
||||
errorPicker.hex = settingsContainer.feedbackErrorColor
|
||||
}
|
||||
|
||||
Component.onCompleted: syncColors()
|
||||
|
||||
Connections {
|
||||
target: settingsContainer
|
||||
function onChanged() { page.syncColors() }
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: "#161628"
|
||||
@@ -36,21 +48,10 @@ Item {
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Text { text: "Цвет «ОК»:"; color: "#ffffff"; Layout.preferredWidth: 150 }
|
||||
TextField {
|
||||
id: okColor
|
||||
Layout.fillWidth: true
|
||||
text: settingsContainer.feedbackOkColor
|
||||
color: "#ffffff"
|
||||
onEditingFinished: btnController.setFeedbackColors(text, errorColor.text)
|
||||
}
|
||||
Rectangle {
|
||||
width: 28; height: 28; radius: 14
|
||||
color: okColor.text || "#00cc44"
|
||||
border.color: "#80ffffff"; border.width: 1
|
||||
}
|
||||
ColorPickerField {
|
||||
id: okPicker
|
||||
label: "Цвет «ОК»:"
|
||||
onColorChanged: btnController.setFeedbackColors(hex, errorPicker.hex)
|
||||
}
|
||||
|
||||
LabeledSlider {
|
||||
@@ -60,21 +61,10 @@ Item {
|
||||
onMoved: btnController.setFeedbackWidths(value, settingsContainer.feedbackErrorWidth)
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Text { text: "Цвет «Ошибка»:"; color: "#ffffff"; Layout.preferredWidth: 150 }
|
||||
TextField {
|
||||
id: errorColor
|
||||
Layout.fillWidth: true
|
||||
text: settingsContainer.feedbackErrorColor
|
||||
color: "#ffffff"
|
||||
onEditingFinished: btnController.setFeedbackColors(okColor.text, text)
|
||||
}
|
||||
Rectangle {
|
||||
width: 28; height: 28; radius: 14
|
||||
color: errorColor.text || "#cc2200"
|
||||
border.color: "#80ffffff"; border.width: 1
|
||||
}
|
||||
ColorPickerField {
|
||||
id: errorPicker
|
||||
label: "Цвет «Ошибка»:"
|
||||
onColorChanged: btnController.setFeedbackColors(okPicker.hex, hex)
|
||||
}
|
||||
|
||||
LabeledSlider {
|
||||
|
||||
Reference in New Issue
Block a user