[epiphany/wip/exalm/history: 2/2] history-dialog: Implement Esc-to-close again
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [epiphany/wip/exalm/history: 2/2] history-dialog: Implement Esc-to-close again
- Date: Sat, 20 Feb 2021 11:19:19 +0000 (UTC)
commit bed8b0ec81f59148d8329e1b86169b7305dd2da5
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]