[gnome-calendar] edit-dialog: show/hide Repeat widgets correctly



commit 22fca75548636a911f586ce9b730083d17280996
Author: Yash Singh <yashdev10p gmail com>
Date:   Fri Jul 14 23:51:17 2017 +0530

    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 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-edit-dialog.c b/src/gcal-edit-dialog.c
index eefa6ef..c66ff41 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:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]