[gnome-contacts/new-design] Keep row focus on exit of edit mode if a child had focus
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts/new-design] Keep row focus on exit of edit mode if a child had focus
- Date: Thu, 15 Dec 2011 10:45:17 +0000 (UTC)
commit bfc7e3a21a603957a8aeca49b7c2ccddb7cf3c04
Author: Alexander Larsson <alexl redhat com>
Date: Thu Dec 15 11:23:23 2011 +0100
Keep row focus on exit of edit mode if a child had focus
src/contacts-contact-pane.vala | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/src/contacts-contact-pane.vala b/src/contacts-contact-pane.vala
index 03e7731..47e3ca4 100644
--- a/src/contacts-contact-pane.vala
+++ b/src/contacts-contact-pane.vala
@@ -778,6 +778,8 @@ public abstract class Contacts.DataFieldRow : FieldRow {
}
public void exit_edit_mode (bool save) {
+ var had_child_focus = this.get_focus_child () != null;
+
var parent = this.get_parent ();
if (parent != null) {
var parent_container = (parent as Container);
@@ -794,6 +796,8 @@ public abstract class Contacts.DataFieldRow : FieldRow {
update ();
this.show_all ();
this.set_can_focus (true);
+ if (had_child_focus)
+ this.grab_focus ();
if (save && changed)
field_set.save ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]