[gnome-builder/wip/gtk4-port] plugins/symbol-tree: return to editor with Escape



commit 846c0ddbdb6dd6a82995411187b6b102da853cc3
Author: Christian Hergert <chergert redhat com>
Date:   Fri May 13 08:25:51 2022 -0700

    plugins/symbol-tree: return to editor with Escape

 src/plugins/symbol-tree/gbp-symbol-popover.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/src/plugins/symbol-tree/gbp-symbol-popover.c b/src/plugins/symbol-tree/gbp-symbol-popover.c
index e812685ab..9e91be418 100644
--- a/src/plugins/symbol-tree/gbp-symbol-popover.c
+++ b/src/plugins/symbol-tree/gbp-symbol-popover.c
@@ -162,6 +162,18 @@ on_search_key_pressed_cb (GbpSymbolPopover      *self,
     {
       switch (keyval)
         {
+        case GDK_KEY_Escape:
+          {
+            IdeWorkspace *workspace = ide_widget_get_workspace (GTK_WIDGET (self));
+            IdePage *page = ide_workspace_get_most_recent_page (workspace);
+
+            gtk_popover_popdown (GTK_POPOVER (self));
+            if (page)
+              gtk_widget_grab_focus (GTK_WIDGET (page));
+
+            return TRUE;
+          }
+
         case GDK_KEY_Up:
         case GDK_KEY_KP_Up:
           ide_gtk_list_view_move_previous (self->list_view);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]