From 270bd5eef87451fc1536306724bbd7870c79b147 Mon Sep 17 00:00:00 2001 From: Ales Kutsepau Date: Mon, 16 Mar 2026 16:42:37 +0100 Subject: [PATCH 1/4] Changed the behviour of TableViewTextInput to loose focus on enter/return pressed --- src/EasyApp/Gui/Components/TableViewTextInput.qml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/EasyApp/Gui/Components/TableViewTextInput.qml b/src/EasyApp/Gui/Components/TableViewTextInput.qml index fecc3d9e..902aaa89 100644 --- a/src/EasyApp/Gui/Components/TableViewTextInput.qml +++ b/src/EasyApp/Gui/Components/TableViewTextInput.qml @@ -8,4 +8,13 @@ EaElements.TextInput { height: parent.height horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter + + Keys.onReturnPressed: { + accepted() + focus = false + } + Keys.onEnterPressed: { + accepted() + focus = false + } } From 0b5fec2cea5e425c1dfab79e74826060645cb2ec Mon Sep 17 00:00:00 2001 From: Ales Kutsepau Date: Tue, 17 Mar 2026 14:39:44 +0100 Subject: [PATCH 2/4] Moved the logic of toggling focus to TextField and TextInput --- src/EasyApp/Gui/Components/TableViewTextInput.qml | 9 --------- src/EasyApp/Gui/Elements/TextField.qml | 10 ++++++++++ src/EasyApp/Gui/Elements/TextInput.qml | 10 ++++++++++ 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/src/EasyApp/Gui/Components/TableViewTextInput.qml b/src/EasyApp/Gui/Components/TableViewTextInput.qml index 902aaa89..fecc3d9e 100644 --- a/src/EasyApp/Gui/Components/TableViewTextInput.qml +++ b/src/EasyApp/Gui/Components/TableViewTextInput.qml @@ -8,13 +8,4 @@ EaElements.TextInput { height: parent.height horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter - - Keys.onReturnPressed: { - accepted() - focus = false - } - Keys.onEnterPressed: { - accepted() - focus = false - } } diff --git a/src/EasyApp/Gui/Elements/TextField.qml b/src/EasyApp/Gui/Elements/TextField.qml index bebbb9ba..c4d3adab 100644 --- a/src/EasyApp/Gui/Elements/TextField.qml +++ b/src/EasyApp/Gui/Elements/TextField.qml @@ -80,6 +80,16 @@ T.TextField { Behavior on border.color { EaAnimations.ThemeChange {} } } + // Visual feedback for the user that editing finish was accepted + Keys.onReturnPressed: { + accepted() + focus = false + } + Keys.onEnterPressed: { + accepted() + focus = false + } + //Mouse area to react on click events MouseArea { id: mouseArea diff --git a/src/EasyApp/Gui/Elements/TextInput.qml b/src/EasyApp/Gui/Elements/TextInput.qml index 0d8314e0..320e2a96 100644 --- a/src/EasyApp/Gui/Elements/TextInput.qml +++ b/src/EasyApp/Gui/Elements/TextInput.qml @@ -66,6 +66,16 @@ T.TextField { color: 'transparent' } + // Visual feedback for the user that editing finish was accepted + Keys.onReturnPressed: { + accepted() + focus = false + } + Keys.onEnterPressed: { + accepted() + focus = false + } + //Mouse area to react on click events MouseArea { id: mouseArea From b114e1e0d346479dae797f62ebf6a0f2ae2562a3 Mon Sep 17 00:00:00 2001 From: Ales Kutsepau Date: Tue, 24 Mar 2026 12:05:03 +0100 Subject: [PATCH 3/4] fixes to include validation logic --- src/EasyApp/Gui/Elements/TextField.qml | 16 +++++++++++----- src/EasyApp/Gui/Elements/TextInput.qml | 16 +++++++++++----- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/EasyApp/Gui/Elements/TextField.qml b/src/EasyApp/Gui/Elements/TextField.qml index c4d3adab..9f62cbfc 100644 --- a/src/EasyApp/Gui/Elements/TextField.qml +++ b/src/EasyApp/Gui/Elements/TextField.qml @@ -81,15 +81,21 @@ T.TextField { } // Visual feedback for the user that editing finish was accepted - Keys.onReturnPressed: { - accepted() - focus = false - } - Keys.onEnterPressed: { + function _commit(event) { + if (!acceptableInput) { + warned = true + event.accepted = true + return + } + warned = false accepted() focus = false + event.accepted = true } + Keys.onReturnPressed: (event) => _commit(event) + Keys.onEnterPressed: (event) => _commit(event) + //Mouse area to react on click events MouseArea { id: mouseArea diff --git a/src/EasyApp/Gui/Elements/TextInput.qml b/src/EasyApp/Gui/Elements/TextInput.qml index 320e2a96..64c54fac 100644 --- a/src/EasyApp/Gui/Elements/TextInput.qml +++ b/src/EasyApp/Gui/Elements/TextInput.qml @@ -67,15 +67,21 @@ T.TextField { } // Visual feedback for the user that editing finish was accepted - Keys.onReturnPressed: { - accepted() - focus = false - } - Keys.onEnterPressed: { + function _commit(event) { + if (!acceptableInput) { + warned = true + event.accepted = true + return + } + warned = false accepted() focus = false + event.accepted = true } + Keys.onReturnPressed: (event) => _commit(event) + Keys.onEnterPressed: (event) => _commit(event) + //Mouse area to react on click events MouseArea { id: mouseArea From 1d9d2e55267a02f76a1545344ebea0f3e2bd3d05 Mon Sep 17 00:00:00 2001 From: Ales Kutsepau Date: Fri, 10 Apr 2026 14:47:14 +0200 Subject: [PATCH 4/4] Replaced defocus with a color flash --- src/EasyApp/Gui/Elements/TextField.qml | 27 +++++++++++++------------- src/EasyApp/Gui/Elements/TextInput.qml | 27 +++++++++++++------------- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/src/EasyApp/Gui/Elements/TextField.qml b/src/EasyApp/Gui/Elements/TextField.qml index 9f62cbfc..ddebe6e1 100644 --- a/src/EasyApp/Gui/Elements/TextField.qml +++ b/src/EasyApp/Gui/Elements/TextField.qml @@ -11,6 +11,7 @@ T.TextField { id: control property bool warned: false + property bool enterFlash: false implicitWidth: implicitBackgroundWidth + leftInset + rightInset || Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding @@ -31,7 +32,9 @@ T.TextField { font.pixelSize: EaStyle.Sizes.fontPixelSize //font.bold: control.activeFocus ? true : false - color: warned ? + color: enterFlash ? + EaStyle.Colors.themeForeground : + warned ? EaStyle.Colors.red : !enabled ? EaStyle.Colors.themeForegroundDisabled : @@ -80,21 +83,17 @@ T.TextField { Behavior on border.color { EaAnimations.ThemeChange {} } } - // Visual feedback for the user that editing finish was accepted - function _commit(event) { - if (!acceptableInput) { - warned = true - event.accepted = true - return - } - warned = false - accepted() - focus = false - event.accepted = true + onAccepted: { + control.enterFlash = true + enterFlashTimer.start() } - Keys.onReturnPressed: (event) => _commit(event) - Keys.onEnterPressed: (event) => _commit(event) + // Visual feedback for the user that editing finish was accepted + Timer { + id: enterFlashTimer + interval: 180 + onTriggered: control.enterFlash = false + } //Mouse area to react on click events MouseArea { diff --git a/src/EasyApp/Gui/Elements/TextInput.qml b/src/EasyApp/Gui/Elements/TextInput.qml index 64c54fac..54a91ebf 100644 --- a/src/EasyApp/Gui/Elements/TextInput.qml +++ b/src/EasyApp/Gui/Elements/TextInput.qml @@ -14,6 +14,7 @@ T.TextField { property bool warned: false property bool selected: false property bool minored: false + property bool enterFlash: false implicitWidth: implicitBackgroundWidth + leftInset + rightInset || Math.max(contentWidth, placeholder.implicitWidth) + leftPadding + rightPadding @@ -27,7 +28,9 @@ T.TextField { font.pixelSize: EaStyle.Sizes.fontPixelSize font.bold: control.activeFocus ? true : false - color: warned ? + color: enterFlash ? + EaStyle.Colors.themeForeground : + warned ? EaStyle.Colors.red : !enabled || readOnly || minored ? EaStyle.Colors.themeForegroundMinor : @@ -66,21 +69,17 @@ T.TextField { color: 'transparent' } - // Visual feedback for the user that editing finish was accepted - function _commit(event) { - if (!acceptableInput) { - warned = true - event.accepted = true - return - } - warned = false - accepted() - focus = false - event.accepted = true + onAccepted: { + control.enterFlash = true + enterFlashTimer.start() } - Keys.onReturnPressed: (event) => _commit(event) - Keys.onEnterPressed: (event) => _commit(event) + // Visual feedback for the user that editing finish was accepted + Timer { + id: enterFlashTimer + interval: 180 + onTriggered: control.enterFlash = false + } //Mouse area to react on click events MouseArea {