[gnome-calendar/new-year-view] year-view: update sidebar on year changing



commit 908ed7e929a3101d2452587b063cf3d4b214a7b5
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Tue Jan 20 00:28:00 2015 -0500

    year-view: update sidebar on year changing

 src/gcal-year-view.c |   25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)
---
diff --git a/src/gcal-year-view.c b/src/gcal-year-view.c
index bf24dc4..e04d9a8 100644
--- a/src/gcal-year-view.c
+++ b/src/gcal-year-view.c
@@ -103,6 +103,7 @@ enum
 
 static guint signals[NUM_SIGNALS] = { 0, };
 
+static void   reset_sidebar (GcalYearView *year_view);
 static void   gcal_view_interface_init (GcalViewIface *iface);
 static void   gcal_data_model_subscriber_interface_init (ECalDataModelSubscriberInterface *iface);
 
@@ -142,6 +143,9 @@ update_date (GcalYearView *year_view,
 
       gcal_manager_set_subscriber (priv->manager, E_CAL_DATA_MODEL_SUBSCRIBER (year_view), range_start, 
range_end);
       gtk_widget_queue_draw (GTK_WIDGET (year_view));
+
+      if (priv->start_selected_date->day != 0)
+        reset_sidebar (year_view);
     }
 
   if (priv->date != NULL)
@@ -311,6 +315,15 @@ update_sidebar (GcalYearView *year_view)
 }
 
 static void
+reset_sidebar (GcalYearView *year_view)
+{
+  memset (year_view->priv->selected_data, 0, sizeof (ButtonData));
+  gtk_widget_queue_draw (GTK_WIDGET (year_view));
+
+  update_sidebar (year_view);
+}
+
+static void
 update_sidebar_headers (GtkListBoxRow *row,
                         GtkListBoxRow *before,
                         gpointer user_data)
@@ -805,10 +818,7 @@ navigator_button_release_cb (GcalYearView   *year_view,
 
 fail:
   priv->button_pressed = FALSE;
-  memset (priv->selected_data, 0, sizeof (ButtonData));
-  gtk_widget_queue_draw (widget);
-
-  update_sidebar (year_view);
+  reset_sidebar (year_view);
   return TRUE;
 }
 
@@ -867,12 +877,7 @@ static void
 popover_closed_cb (GcalYearView *year_view,
                    GtkPopover   *popover)
 {
-  GcalYearViewPrivate *priv = year_view->priv;
-
-  memset (priv->selected_data, 0, sizeof (ButtonData));
-  gtk_widget_queue_draw (priv->navigator);
-
-  update_sidebar (year_view);
+  reset_sidebar (year_view);
 }
 
 static void


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