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
This commit is contained in:
Matthias Clasen
2009-02-17 05:36:12 +00:00
parent 7385bb11b9
commit b159282465
2 changed files with 35 additions and 0 deletions

View File

@@ -1,3 +1,16 @@
2009-02-16 MatthiasClasen <mclasen@redhat.com>
Bug 572041 Focus should change when advancing forward in GtkAssistant
* gtk/gtkassistant.c (set_current_page): Set focus when the current
page changes. Pointed out by Eitan Isaacson
2009-02-16 MatthiasClasen <mclasen@redhat.com>
* configure.in: Require GLib 2.19.7 for GMountOperation::aborted.
* gtk/gtkmountoperation.c: Implement GMountOperation::aborted.
2009-02-16 Sven Neumann <sven@gimp.org>
* gdk/gdk.symbols

View File

@@ -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));
}