Switch tabs on Enter and Space when navigating using keyboard

master
Yevgen Muntyan 2007-05-08 00:54:37 -05:00
parent 4f182406ad
commit fa3e56a6dd
1 changed files with 16 additions and 2 deletions

View File

@ -3028,8 +3028,9 @@ moo_notebook_scroll_event (GtkWidget *widget,
} }
static gboolean moo_notebook_key_press (GtkWidget *widget, static gboolean
GdkEventKey *event) moo_notebook_key_press (GtkWidget *widget,
GdkEventKey *event)
{ {
MooNotebook *nb = MOO_NOTEBOOK (widget); MooNotebook *nb = MOO_NOTEBOOK (widget);
@ -3038,6 +3039,19 @@ static gboolean moo_notebook_key_press (GtkWidget *widget,
tab_drag_end (nb, FALSE); tab_drag_end (nb, FALSE);
return TRUE; return TRUE;
} }
else if (GTK_WIDGET_HAS_FOCUS (nb) &&
nb->priv->focus == FOCUS_NONE &&
nb->priv->focus_page &&
nb->priv->focus_page != nb->priv->current_page)
{
switch (event->keyval)
{
case GDK_Return:
case GDK_space:
moo_notebook_set_current_page (nb, page_index (nb, nb->priv->focus_page));
return TRUE;
}
}
return FALSE; return FALSE;
} }