mirror of
https://github.com/hulthe/inkopslista.git
synced 2026-08-03 23:11:28 +02:00
Make inputting nicer
This commit is contained in:
+11
-1
@@ -114,6 +114,12 @@ component AddView inherits VerticalLayout {
|
||||
height: 42px;
|
||||
input := LineEdit {
|
||||
font-size: 20px;
|
||||
accepted(text) => {
|
||||
if text != "" {
|
||||
State.add-to-list(text);
|
||||
input.text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
@@ -124,7 +130,11 @@ component AddView inherits VerticalLayout {
|
||||
width: self.height;
|
||||
text: "+";
|
||||
clicked => {
|
||||
State.add-to-list(input.text);
|
||||
if input.text != "" {
|
||||
State.add-to-list(input.text);
|
||||
input.text = "";
|
||||
}
|
||||
input.clear-focus()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user