From 2cd6e94cc567284a10c4545208f53ea8421ee8d1 Mon Sep 17 00:00:00 2001 From: hrxi Date: Wed, 23 Aug 2017 17:49:55 +0200 Subject: Focus selected widgets in the accounts dialog Previously, you had to issue two clicks in order to enter something into the text fields. This also replaces the `Entry` widgets with their label counterparts once they lose focus. Since the `ComboBox` handling of focus seems to be buggy (`focus_out_event` not firing), the OpenPGP key selection lacks the latter feature. --- main/src/ui/util/label_hybrid.vala | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'main') diff --git a/main/src/ui/util/label_hybrid.vala b/main/src/ui/util/label_hybrid.vala index a16bccf7..ab765dd1 100644 --- a/main/src/ui/util/label_hybrid.vala +++ b/main/src/ui/util/label_hybrid.vala @@ -20,6 +20,7 @@ public class LabelHybrid : Stack { public void show_widget() { visible_child_name = "widget"; + get_child_by_name("widget").grab_focus(); } public void show_label() { @@ -86,6 +87,10 @@ public class EntryLabelHybrid : LabelHybrid { } return false; }); + entry.focus_out_event.connect(() => { + show_label(); + return false; + }); } private void update_label() { @@ -134,6 +139,11 @@ public class ComboBoxTextLabelHybrid : LabelHybrid { update_label(); show_label(); }); + combobox.focus_out_event.connect(() => { + update_label(); + show_label(); + return false; + }); button.clicked.connect(() => { combobox.popup(); }); -- cgit v1.2.3-70-g09d2