diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-16 16:01:38 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-16 16:03:25 +0200 |
commit | fa65ced22f1c74a095394a0e3362b9939321c800 (patch) | |
tree | cac07c2aa5274e3c1fc763416a541b4ad9a3ef25 /src/ui/window.c | |
parent | 74861693e2e51b2ba4da7dd6c36f9e8c3d9b76e9 (diff) |
Closing the sidebar with Escape
Diffstat (limited to 'src/ui/window.c')
-rw-r--r-- | src/ui/window.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/ui/window.c b/src/ui/window.c index ba6ee869..63f19e3f 100644 --- a/src/ui/window.c +++ b/src/ui/window.c | |||
@@ -326,7 +326,7 @@ static iBool handleSearchBarCommands_(iWidget *searchBar, const char *cmd) { | |||
326 | else if (equal_Command(cmd, "focus.gained")) { | 326 | else if (equal_Command(cmd, "focus.gained")) { |
327 | if (pointer_Command(cmd) == findChild_Widget(searchBar, "find.input")) { | 327 | if (pointer_Command(cmd) == findChild_Widget(searchBar, "find.input")) { |
328 | if (!isVisible_Widget(searchBar)) { | 328 | if (!isVisible_Widget(searchBar)) { |
329 | setFlags_Widget(searchBar, hidden_WidgetFlag, iFalse); | 329 | setFlags_Widget(searchBar, hidden_WidgetFlag | disabled_WidgetFlag, iFalse); |
330 | arrange_Widget(get_Window()->root); | 330 | arrange_Widget(get_Window()->root); |
331 | refresh_App(); | 331 | refresh_App(); |
332 | } | 332 | } |
@@ -334,16 +334,13 @@ static iBool handleSearchBarCommands_(iWidget *searchBar, const char *cmd) { | |||
334 | } | 334 | } |
335 | else if (equal_Command(cmd, "find.close")) { | 335 | else if (equal_Command(cmd, "find.close")) { |
336 | if (isVisible_Widget(searchBar)) { | 336 | if (isVisible_Widget(searchBar)) { |
337 | setFlags_Widget(searchBar, hidden_WidgetFlag, iTrue); | 337 | setFlags_Widget(searchBar, hidden_WidgetFlag | disabled_WidgetFlag, iTrue); |
338 | arrange_Widget(searchBar->parent); | 338 | arrange_Widget(searchBar->parent); |
339 | if (isFocused_Widget(findChild_Widget(searchBar, "find.input"))) { | 339 | if (isFocused_Widget(findChild_Widget(searchBar, "find.input"))) { |
340 | setFocus_Widget(NULL); | 340 | setFocus_Widget(NULL); |
341 | } | 341 | } |
342 | refresh_Widget(searchBar->parent); | 342 | refresh_Widget(searchBar->parent); |
343 | } | 343 | } |
344 | else if (isVisible_Widget(findWidget_App("sidebar"))) { | ||
345 | postCommand_App("sidebar.toggle"); | ||
346 | } | ||
347 | return iTrue; | 344 | return iTrue; |
348 | } | 345 | } |
349 | return iFalse; | 346 | return iFalse; |
@@ -446,8 +443,9 @@ static void setupUserInterface_Window(iWindow *d) { | |||
446 | iWidget *searchBar = new_Widget(); | 443 | iWidget *searchBar = new_Widget(); |
447 | setId_Widget(searchBar, "search"); | 444 | setId_Widget(searchBar, "search"); |
448 | setFlags_Widget(searchBar, | 445 | setFlags_Widget(searchBar, |
449 | hidden_WidgetFlag | collapse_WidgetFlag | arrangeHeight_WidgetFlag | | 446 | hidden_WidgetFlag | disabled_WidgetFlag | collapse_WidgetFlag | |
450 | resizeChildren_WidgetFlag | arrangeHorizontal_WidgetFlag, | 447 | arrangeHeight_WidgetFlag | resizeChildren_WidgetFlag | |
448 | arrangeHorizontal_WidgetFlag, | ||
451 | iTrue); | 449 | iTrue); |
452 | addChild_Widget(div, iClob(searchBar)); | 450 | addChild_Widget(div, iClob(searchBar)); |
453 | setBackgroundColor_Widget(searchBar, uiBackground_ColorId); | 451 | setBackgroundColor_Widget(searchBar, uiBackground_ColorId); |