summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfo-cppsp <[email protected]>2018-01-31 15:07:20 +0100
committermonsta <[email protected]>2018-04-01 13:19:10 +0300
commiteb57c734d24892f2668ed5e74f8fab1483fe3b22 (patch)
tree098982707e9d46c12b893909efa7819dce9155b4
parent68395eabb30144f0c1675507d0e292f90e04ebd3 (diff)
downloadmate-panel-eb57c734d24892f2668ed5e74f8fab1483fe3b22.tar.bz2
mate-panel-eb57c734d24892f2668ed5e74f8fab1483fe3b22.tar.xz
Fix run dialog show-program-list enabling
fix #296 (squashed f20f4b9e45c1ac33e651fdd77ccf8a530c894d73 + f6224f1c09acb8e93718338ea6a6c4cafe20c23c for 1.18 branch)
-rw-r--r--mate-panel/panel-run-dialog.c42
1 files changed, 35 insertions, 7 deletions
diff --git a/mate-panel/panel-run-dialog.c b/mate-panel/panel-run-dialog.c
index 6e45a272..0cc31018 100644
--- a/mate-panel/panel-run-dialog.c
+++ b/mate-panel/panel-run-dialog.c
@@ -1115,6 +1115,7 @@ static void
panel_run_dialog_update_content (PanelRunDialog *dialog,
gboolean show_list)
{
+
if (!panel_profile_get_enable_program_list ()) {
GtkWidget *parent;
@@ -1126,15 +1127,42 @@ 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);
+ /* the following two conditions occur, when the user clicks the expander in the dialog
+ * 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);
+ }
+
+ /* the following two conditions occur, when the user changes the expander setting in GSettings */
+ 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);
+
+ /* 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);
}
+ }
}
static void