summaryrefslogtreecommitdiff
path: root/gtk/gtkwindow.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-01-29 19:44:49 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-01-29 19:44:49 +0000
commit854372b9be425955fccd2f6c2ef70b3719b5183d (patch)
tree86d556dc7a9e2e96a041f0f082a0af747805d20e /gtk/gtkwindow.c
parentcac17ab7b4d1f549547996e7cf3c0f4c41ae2a1e (diff)
downloadgtk+-854372b9be425955fccd2f6c2ef70b3719b5183d.tar.gz
Add <Control>Tab bindings for "move-focus" so that Control-Tab to escape
Tue Jan 29 14:24:49 2002 Owen Taylor <otaylor@redhat.com> * gtk/gtkwindow.c (gtk_window_class_init): Add <Control>Tab bindings for "move-focus" so that Control-Tab to escape from something that eats Tab just works if not otherwise overriden. * gtk/gtkspinbutton.c (gtk_spin_button_new_with_range) * gtk/gtkvscale.c (gtk_vscale_new_with_range) * gtk/gtkhscale.c (gtk_hscale_new_with_range): Use a page_size of zero for the adjustment, since at times we think that the range is lower to upper - page_size. A page size equally to the step_increment is, in any case, not meaningful.
Diffstat (limited to 'gtk/gtkwindow.c')
-rw-r--r--gtk/gtkwindow.c39
1 files changed, 20 insertions, 19 deletions
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 1695bb151f..8271db1474 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -298,6 +298,22 @@ gtk_window_get_type (void)
}
static void
+add_tab_bindings (GtkBindingSet *binding_set,
+ GdkModifierType modifiers,
+ GtkDirectionType direction)
+{
+ gtk_binding_entry_add_signal (binding_set, GDK_Tab, modifiers,
+ "move_focus", 1,
+ GTK_TYPE_DIRECTION_TYPE, direction);
+ gtk_binding_entry_add_signal (binding_set, GDK_KP_Tab, modifiers,
+ "move_focus", 1,
+ GTK_TYPE_DIRECTION_TYPE, direction);
+ gtk_binding_entry_add_signal (binding_set, GDK_ISO_Left_Tab, modifiers,
+ "move_focus", 1,
+ GTK_TYPE_DIRECTION_TYPE, direction);
+}
+
+static void
gtk_window_class_init (GtkWindowClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
@@ -555,25 +571,10 @@ gtk_window_class_init (GtkWindowClass *klass)
"move_focus", 1,
GTK_TYPE_DIRECTION_TYPE, GTK_DIR_RIGHT);
- gtk_binding_entry_add_signal (binding_set, GDK_Tab, 0,
- "move_focus", 1,
- GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_FORWARD);
- gtk_binding_entry_add_signal (binding_set, GDK_KP_Tab, 0,
- "move_focus", 1,
- GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_FORWARD);
- gtk_binding_entry_add_signal (binding_set, GDK_ISO_Left_Tab, 0,
- "move_focus", 1,
- GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_FORWARD);
-
- gtk_binding_entry_add_signal (binding_set, GDK_Tab, GDK_SHIFT_MASK,
- "move_focus", 1,
- GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_BACKWARD);
- gtk_binding_entry_add_signal (binding_set, GDK_KP_Tab, GDK_SHIFT_MASK,
- "move_focus", 1,
- GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_BACKWARD);
- gtk_binding_entry_add_signal (binding_set, GDK_ISO_Left_Tab, GDK_SHIFT_MASK,
- "move_focus", 1,
- GTK_TYPE_DIRECTION_TYPE, GTK_DIR_TAB_BACKWARD);
+ add_tab_bindings (binding_set, 0, GTK_DIR_TAB_FORWARD);
+ add_tab_bindings (binding_set, GDK_CONTROL_MASK, GTK_DIR_TAB_FORWARD);
+ add_tab_bindings (binding_set, GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD);
+ add_tab_bindings (binding_set, GDK_CONTROL_MASK | GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD);
}
static void