mirror of
https://github.com/monero-project/monero-gui.git
synced 2024-12-14 04:16:33 +02:00
LineEdit: add an error property
This is then used to display a reddish background when it's true
This commit is contained in:
parent
5fb4e89531
commit
b97d0a934d
@ -35,10 +35,18 @@ Item {
|
|||||||
property alias readOnly : input.readOnly
|
property alias readOnly : input.readOnly
|
||||||
property alias cursorPosition: input.cursorPosition
|
property alias cursorPosition: input.cursorPosition
|
||||||
property int fontSize: 18
|
property int fontSize: 18
|
||||||
|
property bool error: false
|
||||||
|
|
||||||
|
|
||||||
height: 37
|
height: 37
|
||||||
|
|
||||||
|
function getColor(error) {
|
||||||
|
if (error)
|
||||||
|
return "#FFDDDD"
|
||||||
|
else
|
||||||
|
return "#FFFFFF"
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.bottomMargin: 1
|
anchors.bottomMargin: 1
|
||||||
@ -49,7 +57,7 @@ Item {
|
|||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.topMargin: 1
|
anchors.topMargin: 1
|
||||||
color: "#FFFFFF"
|
color: getColor(error)
|
||||||
//radius: 4
|
//radius: 4
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user