Commit ddb4b3eb authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

Added "shift" modifier versions of keybings for GtkFileChooser "folder-up"/"folder-down" bindings.

Also updated documentation, closes bug 322926
parent c01c018f
......@@ -222,18 +222,25 @@
* <row>
* <entry>up-folder</entry>
* <entry>
* <keycombo><keycap>Alt</keycap><keycap>Up</keycap></keycombo>
* <keycombo><keycap>Alt</keycap><keycap>Up</keycap></keycombo>;
* <keycombo><keycap>Alt</keycap><keycap>Shift</keycap><keycap>Up</keycap></keycombo>
* <footnote>
* Both the individual Up key and the numeric
* keypad's Up key are supported.
* </footnote>
* ;
* </footnote>;
* <keycap>Backspace</keycap>
* </entry>
* </row>
* <row>
* <entry>down-folder</entry>
* <entry><keycombo><keycap>Alt</keycap><keycap>Down</keycap></keycombo></entry>
* <entry>
* <keycombo><keycap>Alt</keycap><keycap>Down</keycap></keycombo>;
* <keycombo><keycap>Alt</keycap><keycap>Shift</keycap><keycap>Down</keycap></keycombo>
* <footnote>
* Both the individual Down key and the numeric
* keypad's Down key are supported.
* </footnote>
* </entry>
* </row>
* <row>
* <entry>home-folder</entry>
......
......@@ -465,6 +465,22 @@ G_DEFINE_TYPE_WITH_CODE (GtkFileChooserDefault, _gtk_file_chooser_default, GTK_T
G_IMPLEMENT_INTERFACE (GTK_TYPE_FILE_CHOOSER_EMBED,
gtk_file_chooser_embed_default_iface_init));
static void
add_normal_and_shifted_binding (GtkBindingSet *binding_set,
guint keyval,
GdkModifierType modifiers,
const gchar *signal_name)
{
gtk_binding_entry_add_signal (binding_set,
keyval, modifiers,
signal_name, 0);
gtk_binding_entry_add_signal (binding_set,
keyval, modifiers | GDK_SHIFT_MASK,
signal_name, 0);
}
static void
_gtk_file_chooser_default_class_init (GtkFileChooserDefaultClass *class)
{
......@@ -617,27 +633,25 @@ _gtk_file_chooser_default_class_init (GtkFileChooserDefaultClass *class)
GDK_KEY_v, GDK_CONTROL_MASK,
"location-popup-on-paste",
0);
gtk_binding_entry_add_signal (binding_set,
GDK_KEY_Up, GDK_MOD1_MASK,
"up-folder",
0);
gtk_binding_entry_add_signal (binding_set,
GDK_KEY_BackSpace, 0,
"up-folder",
0);
gtk_binding_entry_add_signal (binding_set,
GDK_KEY_KP_Up, GDK_MOD1_MASK,
"up-folder",
0);
gtk_binding_entry_add_signal (binding_set,
GDK_KEY_Down, GDK_MOD1_MASK,
"down-folder",
0);
gtk_binding_entry_add_signal (binding_set,
GDK_KEY_KP_Down, GDK_MOD1_MASK,
"down-folder",
0);
add_normal_and_shifted_binding (binding_set,
GDK_KEY_Up, GDK_MOD1_MASK,
"up-folder");
add_normal_and_shifted_binding (binding_set,
GDK_KEY_KP_Up, GDK_MOD1_MASK,
"up-folder");
add_normal_and_shifted_binding (binding_set,
GDK_KEY_Down, GDK_MOD1_MASK,
"down-folder");
add_normal_and_shifted_binding (binding_set,
GDK_KEY_KP_Down, GDK_MOD1_MASK,
"down-folder");
gtk_binding_entry_add_signal (binding_set,
GDK_KEY_Home, GDK_MOD1_MASK,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment