summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2009-02-17 05:36:12 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2009-02-17 05:36:12 +0000
commitb1592824658cf8a49688ea3eeabd2220b3d13f73 (patch)
tree64fc804c441c2dd94626b7a15fdaee701134a567 /gtk
parent7385bb11b9ec1ed25762533f58a1a386d635974d (diff)
downloadgdk-pixbuf-b1592824658cf8a49688ea3eeabd2220b3d13f73.tar.gz
Set focus when the current page changes. Pointed out by Eitan Isaacson
* gtk/gtkassistant.c (set_current_page): Set focus when the current page changes. Pointed out by Eitan Isaacson svn path=/trunk/; revision=22344
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gtkassistant.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c
index f2b731560..45748b695 100644
--- a/gtk/gtkassistant.c
+++ b/gtk/gtkassistant.c
@@ -559,6 +559,28 @@ set_current_page (GtkAssistant *assistant,
gtk_widget_unmap (old_page->title);
}
+ if (!gtk_widget_child_focus (priv->current_page->page, GTK_DIR_TAB_FORWARD))
+ {
+ GtkWidget *button[6];
+ gint i;
+
+ /* find the best button to focus */
+ button[0] = assistant->apply;
+ button[1] = assistant->close;
+ button[2] = assistant->forward;
+ button[3] = assistant->back;
+ button[4] = assistant->cancel;
+ button[5] = assistant->last;
+ for (i = 0; i < 6; i++)
+ {
+ if (GTK_WIDGET_VISIBLE (button[i]) && GTK_WIDGET_SENSITIVE (button[i]))
+ {
+ gtk_widget_grab_focus (button[i]);
+ break;
+ }
+ }
+ }
+
gtk_widget_queue_resize (GTK_WIDGET (assistant));
}