From f20f4b9e45c1ac33e651fdd77ccf8a530c894d73 Mon Sep 17 00:00:00 2001 From: info-cppsp Date: Wed, 31 Jan 2018 15:07:20 +0100 Subject: Fix run dialog show-program-list enabling fix #296 --- mate-panel/panel-run-dialog.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'mate-panel') diff --git a/mate-panel/panel-run-dialog.c b/mate-panel/panel-run-dialog.c index b906e4f3..50098cb1 100644 --- a/mate-panel/panel-run-dialog.c +++ b/mate-panel/panel-run-dialog.c @@ -1129,15 +1129,28 @@ panel_run_dialog_update_content (PanelRunDialog *dialog, gtk_window_set_resizable (GTK_WINDOW (dialog->run_dialog), FALSE); gtk_widget_grab_focus (dialog->combobox); - } else if (show_list) { - gtk_window_resize (GTK_WINDOW (dialog->run_dialog), 100, 300); - gtk_window_set_resizable (GTK_WINDOW (dialog->run_dialog), TRUE); - gtk_widget_grab_focus (dialog->program_list); + } else { - } else if (!show_list) { - gtk_window_set_resizable (GTK_WINDOW (dialog->run_dialog), FALSE); - gtk_widget_grab_focus (dialog->combobox); + /* if the list is closed and the user wants to see it */ + if (show_list && !gtk_expander_get_expanded (GTK_EXPANDER (dialog->list_expander))) { + + /* open the expander, this shows the list */ + gtk_expander_set_expanded (GTK_EXPANDER (dialog->list_expander), TRUE); + + gtk_window_resize (GTK_WINDOW (dialog->run_dialog), 100, 300); + gtk_window_set_resizable (GTK_WINDOW (dialog->run_dialog), TRUE); + gtk_widget_grab_focus (dialog->program_list); + + /* if the list is open and the user wants to close it */ + } else if (!show_list && gtk_expander_get_expanded (GTK_EXPANDER (dialog->list_expander))) { + + /* close the expander, this hides the list */ + gtk_expander_set_expanded (GTK_EXPANDER (dialog->list_expander), FALSE); + + gtk_window_set_resizable (GTK_WINDOW (dialog->run_dialog), FALSE); + gtk_widget_grab_focus (dialog->combobox); } + } } static void -- cgit v1.2.1