diff --git a/src/EasyApp/Gui/Elements/TextField.qml b/src/EasyApp/Gui/Elements/TextField.qml index bebbb9ba..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,6 +83,18 @@ T.TextField { Behavior on border.color { EaAnimations.ThemeChange {} } } + onAccepted: { + control.enterFlash = true + enterFlashTimer.start() + } + + // 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 { id: mouseArea diff --git a/src/EasyApp/Gui/Elements/TextInput.qml b/src/EasyApp/Gui/Elements/TextInput.qml index 0d8314e0..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,6 +69,18 @@ T.TextField { color: 'transparent' } + onAccepted: { + control.enterFlash = true + enterFlashTimer.start() + } + + // 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 { id: mouseArea