[epiphany/wip/exalm/history] history-dialog: Implement Esc-to-close again




commit bcedfc1ec04058867cd1236252325845bd6de676
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sat Feb 20 16:11:38 2021 +0500

    history-dialog: Implement Esc-to-close again
    
     * If the search bar is open, close it
     * Otherwise, if the selection mode is active, exit it
     * Otherwise, close the window
    
    Fixes https://gitlab.gnome.org/GNOME/epiphany/-/issues/728

 src/ephy-history-dialog.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/src/ephy-history-dialog.c b/src/ephy-history-dialog.c
index 248e58616..679a28930 100644
--- a/src/ephy-history-dialog.c
+++ b/src/ephy-history-dialog.c
@@ -633,6 +633,16 @@ on_key_press_event (EphyHistoryDialog *self,
     }
   }
 
+  if (key->keyval == GDK_KEY_Escape &&
+      !hdy_search_bar_get_search_mode (search_bar)) {
+    if (self->selection_active)
+      set_selection_active (self, FALSE);
+    else
+      gtk_window_close (GTK_WINDOW (self));
+
+    return GDK_EVENT_STOP;
+  }
+
   /* Edge case: Shift + Enter in selection mode
    * Pressing simply Enter without any modifiers activates the focused row,
    * but pressing Enter with modifiers doesn't do anything.


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