Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/EasyApp/Gui/Elements/TextField.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 :
Expand Down Expand Up @@ -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
Expand Down
17 changes: 16 additions & 1 deletion src/EasyApp/Gui/Elements/TextInput.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 :
Expand Down Expand Up @@ -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
Expand Down