From 22fca75548636a911f586ce9b730083d17280996 Mon Sep 17 00:00:00 2001 From: Yash Singh Date: Fri, 14 Jul 2017 23:51:17 +0530 Subject: [PATCH] edit-dialog: show/hide Repeat widgets correctly Currently, the repeat widgets - repeat_duration stack and combobox are visible even when 'No Repeat' is selected in repeat combobox. This patch ensures that the repeat widgets are hidden when 'No Repeat' is selected. When not selected, repeat_duration_combo becomes visible which itself takes care of the visibilty of the stack. https://bugzilla.gnome.org/show_bug.cgi?id=782755 --- src/gcal-edit-dialog.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gcal-edit-dialog.c b/src/gcal-edit-dialog.c index eefa6ef9..c66ff418 100644 --- a/src/gcal-edit-dialog.c +++ b/src/gcal-edit-dialog.c @@ -518,6 +518,7 @@ repeat_type_changed (GtkComboBox *combobox, if (has_recurrence) { gtk_combo_box_set_active (GTK_COMBO_BOX (self->repeat_duration_combo), GCAL_RECURRENCE_FOREVER); + gtk_widget_show (self->repeat_duration_combo); gtk_widget_hide (self->repeat_duration_stack); } } @@ -1290,6 +1291,16 @@ gcal_edit_dialog_set_event (GcalEditDialog *dialog, gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->repeat_duration_combo), limit_type); gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->repeat_combo), frequency); + if (frequency == GCAL_RECURRENCE_NO_REPEAT) + { + gtk_widget_hide (dialog->repeat_duration_combo); + gtk_widget_hide (dialog->repeat_duration_stack); + } + else + { + gtk_widget_show (dialog->repeat_duration_combo); + } + switch (limit_type) { case GCAL_RECURRENCE_COUNT: