[geary/mjog/responsive-layout-fixes: 1/2] client: Fix <Enter> not activating folder tree rows
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/mjog/responsive-layout-fixes: 1/2] client: Fix <Enter> not activating folder tree rows
- Date: Sun, 11 Apr 2021 08:32:56 +0000 (UTC)
commit 869396d0eb95affa1e5dd55b48218846d7afefc0
Author: Michael Gratton <mike vee net>
Date: Sun Apr 11 18:13:33 2021 +1000
client: Fix <Enter> not activating folder tree rows
src/client/sidebar/sidebar-tree.vala | 35 +++++++++--------------------------
1 file changed, 9 insertions(+), 26 deletions(-)
---
diff --git a/src/client/sidebar/sidebar-tree.vala b/src/client/sidebar/sidebar-tree.vala
index c90285d1e..f90f1c25e 100644
--- a/src/client/sidebar/sidebar-tree.vala
+++ b/src/client/sidebar/sidebar-tree.vala
@@ -853,39 +853,22 @@ public class Sidebar.Tree : Gtk.TreeView {
return base.button_press_event(event);
}
- public bool is_keypress_interpreted(Gdk.EventKey event) {
- switch (Gdk.keyval_name(event.keyval)) {
- case "F2":
- case "Delete":
- case "Return":
- case "KP_Enter":
- return true;
-
- default:
- return false;
- }
- }
-
public override bool key_press_event(Gdk.EventKey event) {
+ bool handled = false;
switch (Gdk.keyval_name(event.keyval)) {
- case "Return":
- case "KP_Enter":
- Gtk.TreePath? path = get_current_path();
- if (path != null)
- toggle_branch_expansion(path);
-
- return true;
-
case "F2":
- return rename_in_place();
+ handled = rename_in_place();
+ break;
case "Delete":
Gtk.TreePath? path = get_current_path();
-
- return (path != null) ? destroy_path(path) : false;
+ handled = (path != null) ? destroy_path(path) : false;
+ break;
}
-
- return base.key_press_event(event);
+ if (!handled) {
+ handled = base.key_press_event(event);
+ }
+ return handled;
}
public bool rename_entry_in_place(Sidebar.Entry entry) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]