[seahorse] GenerateSelect: allow iterating using the keyboard.
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [seahorse] GenerateSelect: allow iterating using the keyboard.
- Date: Wed, 15 Aug 2018 07:28:10 +0000 (UTC)
commit 539e5ee53bc4a90db7250cf331637b2396102b0c
Author: Niels De Graef <nielsdegraef gmail com>
Date: Wed Aug 15 09:25:17 2018 +0200
GenerateSelect: allow iterating using the keyboard.
Commit f586e972 introduced as small regression that made it no longer
possible to generate a new item using only the keyboard (i.e. <Ctrl>N
followed by the arrow keys to choose which item).
This commit re-allows this behavior.
src/generate-select.vala | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/generate-select.vala b/src/generate-select.vala
index ce5bc159..723b198d 100644
--- a/src/generate-select.vala
+++ b/src/generate-select.vala
@@ -50,8 +50,12 @@ public class Seahorse.GenerateSelect : Gtk.Dialog {
return ((Gtk.Action) a).label.collate(((Gtk.Action) b).label);
});
- // Select first item
- this.generate_list.select_row(this.generate_list.get_row_at_index(0));
+ // Select first item (and grab focus, so user can use the keyboard immediately)
+ weak Gtk.ListBoxRow? row = this.generate_list.get_row_at_index(0);
+ if (row != null) {
+ this.generate_list.select_row(row);
+ row.grab_focus();
+ }
}
private Gtk.ListBoxRow on_create_row(GLib.Object item) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]