summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfo-cppsp <[email protected]>2018-02-05 15:46:55 +0100
committerraveit65 <[email protected]>2018-03-14 21:08:08 +0100
commit77be765b1726022c2bda6bf578a05f25b8a4714a (patch)
tree1212ebad7eef385301fad43a235abb82ea1aab5a
parent27e2032c99e3a39a15c9c24e016b86420d22afce (diff)
downloadmate-panel-77be765b1726022c2bda6bf578a05f25b8a4714a.tar.bz2
mate-panel-77be765b1726022c2bda6bf578a05f25b8a4714a.tar.xz
run-dialog: use F6 to switch between entry field and program list
fix #676
-rw-r--r--mate-panel/panel-run-dialog.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/mate-panel/panel-run-dialog.c b/mate-panel/panel-run-dialog.c
index 38edf5e0..06729466 100644
--- a/mate-panel/panel-run-dialog.c
+++ b/mate-panel/panel-run-dialog.c
@@ -1892,6 +1892,35 @@ panel_run_dialog_setup_pixmap (PanelRunDialog *dialog,
dialog);
}
+/* this runs after entry_event() */
+static gboolean
+key_press_event (GtkWidget *run_dialog,
+ GdkEventKey *event,
+ PanelRunDialog *dialog)
+{
+
+ /* allow only key presses */
+ if (event->type != GDK_KEY_PRESS)
+ return FALSE;
+
+ /* If the program list is enabled and open and the user presses the F6 key
+ * the focus should jump between GtkComboBoxText and the program list */
+ if (panel_profile_get_enable_program_list () && panel_profile_get_show_program_list () && event->keyval == GDK_KEY_F6) {
+
+ /* jump to the program list from anywhere */
+ if (!gtk_widget_has_focus (dialog->program_list)) {
+ gtk_widget_grab_focus (dialog->program_list);
+ /* on the program list, jump to the entry box */
+ } else {
+ gtk_widget_grab_focus (dialog->combobox);
+ }
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static PanelRunDialog *
panel_run_dialog_new (GdkScreen *screen,
GtkBuilder *gui,
@@ -1920,6 +1949,10 @@ panel_run_dialog_new (GdkScreen *screen,
panel_run_dialog_setup_program_list (dialog, gui);
panel_run_dialog_setup_list_expander (dialog, gui);
+ /* key press event signal for the whole dialog */
+ g_signal_connect (dialog->run_dialog, "key-press-event",
+ G_CALLBACK (key_press_event), dialog);
+
panel_run_dialog_set_default_icon (dialog, FALSE);
panel_run_dialog_update_content (dialog, panel_profile_get_show_program_list ());