Add update_focus helper

This commit is contained in:
Alexander Larsson 2012-05-11 10:12:50 +02:00
parent 620bacad69
commit 3ac7deb791

View file

@ -102,17 +102,20 @@ public class Contacts.Sorted : Container {
return child_info; return child_info;
} }
private void update_focus (ChildInfo? child) {
focus_child = child;
this.grab_focus ();
this.queue_draw ();
}
private void update_selected (ChildInfo? child) { private void update_selected (ChildInfo? child) {
if (child != selected_child) { if (child != selected_child) {
selected_child = child; selected_child = child;
child_selected (selected_child != null ? selected_child.widget : null); child_selected (selected_child != null ? selected_child.widget : null);
queue_draw (); queue_draw ();
} }
if (child != null) { if (child != null)
focus_child = child; update_focus (child);
this.grab_focus ();
this.queue_draw ();
}
} }
private void update_prelight (ChildInfo? child) { private void update_prelight (ChildInfo? child) {
@ -252,9 +255,7 @@ public class Contacts.Sorted : Container {
if (next_focus_child == null) if (next_focus_child == null)
return false; return false;
focus_child = next_focus_child; update_focus (next_focus_child);
this.grab_focus ();
this.queue_draw ();
return true; return true;
} }