aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ui
diff options
context:
space:
mode:
authorKoni Marti <koni.marti@gmail.com>2023-08-02 11:54:13 +0200
committerRobin Jarry <robin@jarry.cc>2023-08-03 22:25:42 +0200
commit6713a8f4588f26f46c3e5fe0a69ead0f345617f3 (patch)
treee4ad5c23af2b812450acd151b158a1e2f4f21b61 /lib/ui
parente32cf3d478e746e1a83a1289e47399087fe1fda3 (diff)
downloadaerc-6713a8f4588f26f46c3e5fe0a69ead0f345617f3.tar.gz
wizard: display warning when focus is lost
Display the warning that the password is stored in plaintext after the focus of the password input field is lost. The current behavior of showing the warning after the first character is entered is ackward and confusing. It also eliminates the need to debounce the warning when a password is pasted. Reported-by: Brad <super1337@posteo.net> Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/ui')
-rw-r--r--lib/ui/tab.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ui/tab.go b/lib/ui/tab.go
index b62764fb..6a5cbf50 100644
--- a/lib/ui/tab.go
+++ b/lib/ui/tab.go
@@ -157,6 +157,9 @@ func (tabs *Tabs) selectPriv(index int) bool {
if vis, ok := prev.Content.(Visible); ok {
vis.Show(false)
}
+ if vis, ok := prev.Content.(Interactive); ok {
+ vis.Focus(false)
+ }
tabs.pushHistory(tabs.curIndex)
}
tabs.curIndex = index
@@ -164,6 +167,9 @@ func (tabs *Tabs) selectPriv(index int) bool {
if vis, ok := next.Content.(Visible); ok {
vis.Show(true)
}
+ if vis, ok := next.Content.(Interactive); ok {
+ vis.Focus(true)
+ }
Invalidate()
}
return true