summaryrefslogtreecommitdiff
path: root/src/ui/window.c
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-07-27 10:54:23 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-07-27 10:54:23 +0300
commitd7a3e153e83cba0a98233fde7e173de1408dfc77 (patch)
tree48c3421ed98442699f95019db761cb0961d42ffb /src/ui/window.c
parent5d147719af7122df58bbfbe9cfcd8d5271dd01cc (diff)
InputWidget: Notify whether Enter was pressed
Diffstat (limited to 'src/ui/window.c')
-rw-r--r--src/ui/window.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ui/window.c b/src/ui/window.c
index ac9cbd97..79715b6e 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -121,9 +121,10 @@ static iBool handleSearchBarCommands_(iWidget *searchBar, const char *cmd) {
121 if (equal_Command(cmd, "input.ended") && 121 if (equal_Command(cmd, "input.ended") &&
122 cmp_String(string_Command(cmd, "id"), "find.input") == 0) { 122 cmp_String(string_Command(cmd, "id"), "find.input") == 0) {
123 iInputWidget *input = findChild_Widget(searchBar, "find.input"); 123 iInputWidget *input = findChild_Widget(searchBar, "find.input");
124 if (arg_Command(cmd) && isVisible_Widget(as_Widget(input))) { 124 if (arg_Command(cmd) && argLabel_Command(cmd, "enter") &&
125 isVisible_Widget(as_Widget(input))) {
125 postCommand_App("find.next"); 126 postCommand_App("find.next");
126 /* Keep focus. */ 127 /* Keep focus when pressing Enter. */
127 if (!isEmpty_String(text_InputWidget(input))) { 128 if (!isEmpty_String(text_InputWidget(input))) {
128 postCommand_App("focus.set id:find.input"); 129 postCommand_App("focus.set id:find.input");
129 } 130 }