views/week-view: Replace "context" property with context getter method
Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/702>
This commit is contained in:
@@ -1225,7 +1225,6 @@ gcal_window_constructed (GObject *object)
|
|||||||
* FIXME: this is a hack around the issue that happens when trying to bind
|
* FIXME: this is a hack around the issue that happens when trying to bind
|
||||||
* these properties using the GtkBuilder .ui file.
|
* these properties using the GtkBuilder .ui file.
|
||||||
*/
|
*/
|
||||||
g_object_bind_property (self, "context", self->week_view, "context", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
|
||||||
g_object_bind_property (self, "context", self->month_view, "context", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
g_object_bind_property (self, "context", self->month_view, "context", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
||||||
g_object_bind_property (self, "context", self->agenda_view, "context", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
g_object_bind_property (self, "context", self->agenda_view, "context", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
||||||
g_object_bind_property (self, "context", self->date_chooser, "context", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
g_object_bind_property (self, "context", self->date_chooser, "context", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
||||||
|
|||||||
@@ -76,8 +76,6 @@ struct _GcalWeekGrid
|
|||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
gint event_minutes;
|
gint event_minutes;
|
||||||
} dnd;
|
} dnd;
|
||||||
|
|
||||||
GcalContext *context;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_TYPE (GcalWeekGrid, gcal_week_grid, GTK_TYPE_WIDGET);
|
G_DEFINE_TYPE (GcalWeekGrid, gcal_week_grid, GTK_TYPE_WIDGET);
|
||||||
@@ -352,7 +350,7 @@ move_event_to_cell (GcalWeekGrid *self,
|
|||||||
guint cell,
|
guint cell,
|
||||||
GcalRecurrenceModType mod_type)
|
GcalRecurrenceModType mod_type)
|
||||||
{
|
{
|
||||||
|
GcalContext *context = gcal_application_get_context (GCAL_DEFAULT_APPLICATION);
|
||||||
g_autoptr (GDateTime) week_start = NULL;
|
g_autoptr (GDateTime) week_start = NULL;
|
||||||
g_autoptr (GDateTime) dnd_date = NULL;
|
g_autoptr (GDateTime) dnd_date = NULL;
|
||||||
g_autoptr (GDateTime) new_end = NULL;
|
g_autoptr (GDateTime) new_end = NULL;
|
||||||
@@ -392,7 +390,7 @@ move_event_to_cell (GcalWeekGrid *self,
|
|||||||
gcal_event_set_date_end (changed_event, new_end);
|
gcal_event_set_date_end (changed_event, new_end);
|
||||||
|
|
||||||
/* Commit the changes */
|
/* Commit the changes */
|
||||||
gcal_manager_update_event (gcal_context_get_manager (self->context), changed_event, mod_type);
|
gcal_manager_update_event (gcal_context_get_manager (context), changed_event, mod_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -861,6 +859,7 @@ gcal_week_grid_class_init (GcalWeekGridClass *klass)
|
|||||||
static void
|
static void
|
||||||
gcal_week_grid_init (GcalWeekGrid *self)
|
gcal_week_grid_init (GcalWeekGrid *self)
|
||||||
{
|
{
|
||||||
|
GcalContext *context = gcal_application_get_context (GCAL_DEFAULT_APPLICATION);
|
||||||
GtkDropTarget *drop_target;
|
GtkDropTarget *drop_target;
|
||||||
GtkGesture *click_gesture;
|
GtkGesture *click_gesture;
|
||||||
|
|
||||||
@@ -900,16 +899,6 @@ gcal_week_grid_init (GcalWeekGrid *self)
|
|||||||
g_signal_connect (drop_target, "leave", G_CALLBACK (on_drop_target_leave_cb), self);
|
g_signal_connect (drop_target, "leave", G_CALLBACK (on_drop_target_leave_cb), self);
|
||||||
g_signal_connect (drop_target, "motion", G_CALLBACK (on_drop_target_motion_cb), self);
|
g_signal_connect (drop_target, "motion", G_CALLBACK (on_drop_target_motion_cb), self);
|
||||||
gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (drop_target));
|
gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (drop_target));
|
||||||
}
|
|
||||||
|
|
||||||
/* Public API */
|
|
||||||
void
|
|
||||||
gcal_week_grid_set_context (GcalWeekGrid *self,
|
|
||||||
GcalContext *context)
|
|
||||||
{
|
|
||||||
g_return_if_fail (GCAL_IS_WEEK_GRID (self));
|
|
||||||
|
|
||||||
self->context = context;
|
|
||||||
|
|
||||||
g_signal_connect_object (gcal_context_get_clock (context),
|
g_signal_connect_object (gcal_context_get_clock (context),
|
||||||
"minute-changed",
|
"minute-changed",
|
||||||
@@ -918,10 +907,12 @@ gcal_week_grid_set_context (GcalWeekGrid *self,
|
|||||||
G_CONNECT_SWAPPED);
|
G_CONNECT_SWAPPED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Public API */
|
||||||
void
|
void
|
||||||
gcal_week_grid_add_event (GcalWeekGrid *self,
|
gcal_week_grid_add_event (GcalWeekGrid *self,
|
||||||
GcalEvent *event)
|
GcalEvent *event)
|
||||||
{
|
{
|
||||||
|
GcalContext *context = gcal_application_get_context (GCAL_DEFAULT_APPLICATION);
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
|
|
||||||
g_return_if_fail (GCAL_IS_WEEK_GRID (self));
|
g_return_if_fail (GCAL_IS_WEEK_GRID (self));
|
||||||
@@ -929,7 +920,7 @@ gcal_week_grid_add_event (GcalWeekGrid *self,
|
|||||||
g_object_ref (event);
|
g_object_ref (event);
|
||||||
|
|
||||||
widget = g_object_new (GCAL_TYPE_EVENT_WIDGET,
|
widget = g_object_new (GCAL_TYPE_EVENT_WIDGET,
|
||||||
"context", self->context,
|
"context", context,
|
||||||
"event", event,
|
"event", event,
|
||||||
"orientation", GTK_ORIENTATION_VERTICAL,
|
"orientation", GTK_ORIENTATION_VERTICAL,
|
||||||
"timestamp-policy", GCAL_TIMESTAMP_POLICY_START,
|
"timestamp-policy", GCAL_TIMESTAMP_POLICY_START,
|
||||||
|
|||||||
@@ -30,9 +30,6 @@ G_BEGIN_DECLS
|
|||||||
|
|
||||||
G_DECLARE_FINAL_TYPE (GcalWeekGrid, gcal_week_grid, GCAL, WEEK_GRID, GtkWidget)
|
G_DECLARE_FINAL_TYPE (GcalWeekGrid, gcal_week_grid, GCAL, WEEK_GRID, GtkWidget)
|
||||||
|
|
||||||
void gcal_week_grid_set_context (GcalWeekGrid *week_grid,
|
|
||||||
GcalContext *context);
|
|
||||||
|
|
||||||
void gcal_week_grid_set_first_weekday (GcalWeekGrid *week_grid,
|
void gcal_week_grid_set_first_weekday (GcalWeekGrid *week_grid,
|
||||||
gint nr_day);
|
gint nr_day);
|
||||||
|
|
||||||
|
|||||||
@@ -78,8 +78,6 @@ struct _GcalWeekHeader
|
|||||||
GtkBox *weekdays_box;
|
GtkBox *weekdays_box;
|
||||||
GtkWidget *main_box;
|
GtkWidget *main_box;
|
||||||
|
|
||||||
GcalContext *context;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Stores the events as they come from the week-view
|
* Stores the events as they come from the week-view
|
||||||
* The list will later be iterated after the active date is changed
|
* The list will later be iterated after the active date is changed
|
||||||
@@ -214,6 +212,7 @@ clear_weather_infos (GcalWeekHeader *self)
|
|||||||
static void
|
static void
|
||||||
update_weather_infos (GcalWeekHeader *self)
|
update_weather_infos (GcalWeekHeader *self)
|
||||||
{
|
{
|
||||||
|
GcalContext *context = gcal_application_get_context (GCAL_DEFAULT_APPLICATION);
|
||||||
GPtrArray *weather_infos;
|
GPtrArray *weather_infos;
|
||||||
GcalWeatherService *service;
|
GcalWeatherService *service;
|
||||||
|
|
||||||
@@ -221,8 +220,7 @@ update_weather_infos (GcalWeekHeader *self)
|
|||||||
|
|
||||||
clear_weather_infos (self);
|
clear_weather_infos (self);
|
||||||
|
|
||||||
g_assert (self->context);
|
service = gcal_context_get_weather_service (context);
|
||||||
service = gcal_context_get_weather_service (self->context);
|
|
||||||
|
|
||||||
weather_infos = gcal_weather_service_get_weather_infos (service);
|
weather_infos = gcal_weather_service_get_weather_infos (service);
|
||||||
add_weather_infos (self, weather_infos);
|
add_weather_infos (self, weather_infos);
|
||||||
@@ -787,6 +785,7 @@ add_event_to_grid (GcalWeekHeader *self,
|
|||||||
gint start,
|
gint start,
|
||||||
gint end)
|
gint end)
|
||||||
{
|
{
|
||||||
|
GcalContext *context = gcal_application_get_context (GCAL_DEFAULT_APPLICATION);
|
||||||
g_autoptr (GDateTime) week_start = NULL;
|
g_autoptr (GDateTime) week_start = NULL;
|
||||||
g_autoptr (GDateTime) week_end = NULL;
|
g_autoptr (GDateTime) week_end = NULL;
|
||||||
GtkLayoutManager *layout_manager;
|
GtkLayoutManager *layout_manager;
|
||||||
@@ -804,7 +803,7 @@ add_event_to_grid (GcalWeekHeader *self,
|
|||||||
move_events_at_column (self, DOWN, start, position);
|
move_events_at_column (self, DOWN, start, position);
|
||||||
|
|
||||||
/* Add the event to the grid */
|
/* Add the event to the grid */
|
||||||
widget = gcal_event_widget_new (self->context, event);
|
widget = gcal_event_widget_new (context, event);
|
||||||
setup_event_widget (self, widget);
|
setup_event_widget (self, widget);
|
||||||
|
|
||||||
gtk_grid_attach (self->grid,
|
gtk_grid_attach (self->grid,
|
||||||
@@ -1138,6 +1137,7 @@ move_event_to_cell (GcalWeekHeader *self,
|
|||||||
guint cell,
|
guint cell,
|
||||||
GcalRecurrenceModType mod_type)
|
GcalRecurrenceModType mod_type)
|
||||||
{
|
{
|
||||||
|
GcalContext *context = gcal_application_get_context (GCAL_DEFAULT_APPLICATION);
|
||||||
g_autoptr (GDateTime) week_start = NULL;
|
g_autoptr (GDateTime) week_start = NULL;
|
||||||
g_autoptr (GDateTime) dnd_date = NULL;
|
g_autoptr (GDateTime) dnd_date = NULL;
|
||||||
g_autoptr (GDateTime) new_end = NULL;
|
g_autoptr (GDateTime) new_end = NULL;
|
||||||
@@ -1194,7 +1194,7 @@ move_event_to_cell (GcalWeekHeader *self,
|
|||||||
gcal_event_set_date_start (changed_event, dnd_date);
|
gcal_event_set_date_start (changed_event, dnd_date);
|
||||||
|
|
||||||
/* Commit the changes */
|
/* Commit the changes */
|
||||||
gcal_manager_update_event (gcal_context_get_manager (self->context), changed_event, mod_type);
|
gcal_manager_update_event (gcal_context_get_manager (context), changed_event, mod_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -1542,6 +1542,7 @@ gcal_week_header_class_init (GcalWeekHeaderClass *kclass)
|
|||||||
static void
|
static void
|
||||||
gcal_week_header_init (GcalWeekHeader *self)
|
gcal_week_header_init (GcalWeekHeader *self)
|
||||||
{
|
{
|
||||||
|
GcalContext *context = gcal_application_get_context (GCAL_DEFAULT_APPLICATION);
|
||||||
GtkDropTarget *drop_target;
|
GtkDropTarget *drop_target;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
@@ -1596,15 +1597,6 @@ gcal_week_header_init (GcalWeekHeader *self)
|
|||||||
g_signal_connect (drop_target, "leave", G_CALLBACK (on_drop_target_leave_cb), self);
|
g_signal_connect (drop_target, "leave", G_CALLBACK (on_drop_target_leave_cb), self);
|
||||||
g_signal_connect (drop_target, "motion", G_CALLBACK (on_drop_target_motion_cb), self);
|
g_signal_connect (drop_target, "motion", G_CALLBACK (on_drop_target_motion_cb), self);
|
||||||
gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (drop_target));
|
gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (drop_target));
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gcal_week_header_set_context (GcalWeekHeader *self,
|
|
||||||
GcalContext *context)
|
|
||||||
{
|
|
||||||
g_return_if_fail (GCAL_IS_WEEK_HEADER (self));
|
|
||||||
|
|
||||||
self->context = context;
|
|
||||||
|
|
||||||
g_signal_connect_object (gcal_context_get_clock (context),
|
g_signal_connect_object (gcal_context_get_clock (context),
|
||||||
"day-changed",
|
"day-changed",
|
||||||
@@ -1612,7 +1604,7 @@ gcal_week_header_set_context (GcalWeekHeader *self,
|
|||||||
self,
|
self,
|
||||||
G_CONNECT_SWAPPED);
|
G_CONNECT_SWAPPED);
|
||||||
|
|
||||||
g_signal_connect_object (gcal_context_get_weather_service (self->context),
|
g_signal_connect_object (gcal_context_get_weather_service (context),
|
||||||
"weather-changed",
|
"weather-changed",
|
||||||
G_CALLBACK (on_weather_update),
|
G_CALLBACK (on_weather_update),
|
||||||
self,
|
self,
|
||||||
|
|||||||
@@ -32,9 +32,6 @@ G_BEGIN_DECLS
|
|||||||
|
|
||||||
G_DECLARE_FINAL_TYPE (GcalWeekHeader, gcal_week_header, GCAL, WEEK_HEADER, GtkWidget)
|
G_DECLARE_FINAL_TYPE (GcalWeekHeader, gcal_week_header, GCAL, WEEK_HEADER, GtkWidget)
|
||||||
|
|
||||||
void gcal_week_header_set_context (GcalWeekHeader *self,
|
|
||||||
GcalContext *context);
|
|
||||||
|
|
||||||
void gcal_week_header_add_event (GcalWeekHeader *self,
|
void gcal_week_header_add_event (GcalWeekHeader *self,
|
||||||
GcalEvent *event);
|
GcalEvent *event);
|
||||||
|
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "gcal-week-hour-bar.h"
|
#include "gcal-week-hour-bar.h"
|
||||||
#include "gcal-week-view-common.h"
|
#include "gcal-week-view-common.h"
|
||||||
|
#include "gcal-utils.h"
|
||||||
|
|
||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
|
|
||||||
@@ -28,8 +29,6 @@ struct _GcalWeekHourBar
|
|||||||
GtkBox parent_instance;
|
GtkBox parent_instance;
|
||||||
|
|
||||||
GtkLabel *labels[24];
|
GtkLabel *labels[24];
|
||||||
|
|
||||||
GcalContext *context;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
G_DEFINE_FINAL_TYPE (GcalWeekHourBar, gcal_week_hour_bar, GTK_TYPE_BOX)
|
G_DEFINE_FINAL_TYPE (GcalWeekHourBar, gcal_week_hour_bar, GTK_TYPE_BOX)
|
||||||
@@ -37,10 +36,11 @@ G_DEFINE_FINAL_TYPE (GcalWeekHourBar, gcal_week_hour_bar, GTK_TYPE_BOX)
|
|||||||
static void
|
static void
|
||||||
update_labels (GcalWeekHourBar *self)
|
update_labels (GcalWeekHourBar *self)
|
||||||
{
|
{
|
||||||
|
GcalContext *context = gcal_application_get_context (GCAL_DEFAULT_APPLICATION);
|
||||||
GcalTimeFormat time_format;
|
GcalTimeFormat time_format;
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
time_format = gcal_context_get_time_format (self->context);
|
time_format = gcal_context_get_time_format (context);
|
||||||
|
|
||||||
for (i = 0; i < 24; i++)
|
for (i = 0; i < 24; i++)
|
||||||
{
|
{
|
||||||
@@ -92,6 +92,7 @@ gcal_week_hour_bar_class_init (GcalWeekHourBarClass *klass)
|
|||||||
static void
|
static void
|
||||||
gcal_week_hour_bar_init (GcalWeekHourBar *self)
|
gcal_week_hour_bar_init (GcalWeekHourBar *self)
|
||||||
{
|
{
|
||||||
|
GcalContext *context = gcal_application_get_context (GCAL_DEFAULT_APPLICATION);
|
||||||
gint i;
|
gint i;
|
||||||
|
|
||||||
g_object_set (self,
|
g_object_set (self,
|
||||||
@@ -112,15 +113,6 @@ gcal_week_hour_bar_init (GcalWeekHourBar *self)
|
|||||||
|
|
||||||
self->labels[i] = GTK_LABEL (label);
|
self->labels[i] = GTK_LABEL (label);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
gcal_week_hour_bar_set_context (GcalWeekHourBar *self,
|
|
||||||
GcalContext *context)
|
|
||||||
{
|
|
||||||
g_return_if_fail (GCAL_IS_WEEK_HOUR_BAR (self));
|
|
||||||
|
|
||||||
self->context = context;
|
|
||||||
|
|
||||||
g_signal_connect_object (context,
|
g_signal_connect_object (context,
|
||||||
"notify::time-format",
|
"notify::time-format",
|
||||||
|
|||||||
@@ -29,7 +29,4 @@ G_BEGIN_DECLS
|
|||||||
#define GCAL_TYPE_WEEK_HOUR_BAR (gcal_week_hour_bar_get_type())
|
#define GCAL_TYPE_WEEK_HOUR_BAR (gcal_week_hour_bar_get_type())
|
||||||
G_DECLARE_FINAL_TYPE (GcalWeekHourBar, gcal_week_hour_bar, GCAL, WEEK_HOUR_BAR, GtkBox)
|
G_DECLARE_FINAL_TYPE (GcalWeekHourBar, gcal_week_hour_bar, GCAL, WEEK_HOUR_BAR, GtkBox)
|
||||||
|
|
||||||
void gcal_week_hour_bar_set_context (GcalWeekHourBar *self,
|
|
||||||
GcalContext *context);
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ struct _GcalWeekView
|
|||||||
|
|
||||||
/* property */
|
/* property */
|
||||||
GDateTime *date;
|
GDateTime *date;
|
||||||
GcalContext *context;
|
|
||||||
|
|
||||||
guint scroll_grid_timeout_id;
|
guint scroll_grid_timeout_id;
|
||||||
gulong stack_page_changed_id;
|
gulong stack_page_changed_id;
|
||||||
@@ -74,7 +73,6 @@ enum
|
|||||||
{
|
{
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_DATE,
|
PROP_DATE,
|
||||||
PROP_CONTEXT,
|
|
||||||
PROP_TIME_DIRECTION,
|
PROP_TIME_DIRECTION,
|
||||||
NUM_PROPS
|
NUM_PROPS
|
||||||
};
|
};
|
||||||
@@ -209,22 +207,18 @@ apply_zoom (GcalWeekView *self,
|
|||||||
static void
|
static void
|
||||||
save_zoom_level (GcalWeekView *self)
|
save_zoom_level (GcalWeekView *self)
|
||||||
{
|
{
|
||||||
GSettings *settings;
|
GcalContext *context = gcal_application_get_context (GCAL_DEFAULT_APPLICATION);
|
||||||
|
GSettings *settings = gcal_context_get_settings (context);
|
||||||
|
|
||||||
g_assert (self->context != NULL);
|
|
||||||
|
|
||||||
settings = gcal_context_get_settings (self->context);
|
|
||||||
g_settings_set_double (settings, "week-view-zoom-level", self->zoom_level);
|
g_settings_set_double (settings, "week-view-zoom-level", self->zoom_level);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
restore_zoom_level (GcalWeekView *self)
|
restore_zoom_level (GcalWeekView *self)
|
||||||
{
|
{
|
||||||
GSettings *settings;
|
GcalContext *context = gcal_application_get_context (GCAL_DEFAULT_APPLICATION);
|
||||||
|
GSettings *settings = gcal_context_get_settings (context);
|
||||||
|
|
||||||
g_assert (self->context != NULL);
|
|
||||||
|
|
||||||
settings = gcal_context_get_settings (self->context);
|
|
||||||
self->zoom_level = g_settings_get_double (settings, "week-view-zoom-level");
|
self->zoom_level = g_settings_get_double (settings, "week-view-zoom-level");
|
||||||
|
|
||||||
begin_zoom (self, 0);
|
begin_zoom (self, 0);
|
||||||
@@ -569,8 +563,6 @@ gcal_week_view_finalize (GObject *object)
|
|||||||
|
|
||||||
g_clear_pointer (&self->date, g_date_time_unref);
|
g_clear_pointer (&self->date, g_date_time_unref);
|
||||||
|
|
||||||
g_clear_object (&self->context);
|
|
||||||
|
|
||||||
/* Chain up to parent's finalize() method. */
|
/* Chain up to parent's finalize() method. */
|
||||||
G_OBJECT_CLASS (gcal_week_view_parent_class)->finalize (object);
|
G_OBJECT_CLASS (gcal_week_view_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
@@ -581,24 +573,12 @@ gcal_week_view_set_property (GObject *object,
|
|||||||
const GValue *value,
|
const GValue *value,
|
||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
GcalWeekView *self = (GcalWeekView *) object;
|
|
||||||
|
|
||||||
switch (property_id)
|
switch (property_id)
|
||||||
{
|
{
|
||||||
case PROP_DATE:
|
case PROP_DATE:
|
||||||
gcal_view_set_date (GCAL_VIEW (object), g_value_get_boxed (value));
|
gcal_view_set_date (GCAL_VIEW (object), g_value_get_boxed (value));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_CONTEXT:
|
|
||||||
g_assert (self->context == NULL);
|
|
||||||
self->context = g_value_dup_object (value);
|
|
||||||
|
|
||||||
gcal_week_grid_set_context (GCAL_WEEK_GRID (self->week_grid), self->context);
|
|
||||||
gcal_week_header_set_context (GCAL_WEEK_HEADER (self->header), self->context);
|
|
||||||
gcal_week_hour_bar_set_context (self->hours_bar, self->context);
|
|
||||||
restore_zoom_level (self);
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||||
break;
|
break;
|
||||||
@@ -622,10 +602,6 @@ gcal_week_view_get_property (GObject *object,
|
|||||||
g_value_set_boxed (value, self->date);
|
g_value_set_boxed (value, self->date);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_CONTEXT:
|
|
||||||
g_value_set_object (value, self->context);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PROP_TIME_DIRECTION:
|
case PROP_TIME_DIRECTION:
|
||||||
g_value_set_enum (value, GTK_ORIENTATION_HORIZONTAL);
|
g_value_set_enum (value, GTK_ORIENTATION_HORIZONTAL);
|
||||||
break;
|
break;
|
||||||
@@ -651,7 +627,6 @@ gcal_week_view_class_init (GcalWeekViewClass *klass)
|
|||||||
object_class->get_property = gcal_week_view_get_property;
|
object_class->get_property = gcal_week_view_get_property;
|
||||||
|
|
||||||
g_object_class_override_property (object_class, PROP_DATE, "active-date");
|
g_object_class_override_property (object_class, PROP_DATE, "active-date");
|
||||||
g_object_class_override_property (object_class, PROP_CONTEXT, "context");
|
|
||||||
g_object_class_override_property (object_class, PROP_TIME_DIRECTION, "time-direction");
|
g_object_class_override_property (object_class, PROP_TIME_DIRECTION, "time-direction");
|
||||||
|
|
||||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/ui/views/gcal-week-view.ui");
|
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/calendar/ui/views/gcal-week-view.ui");
|
||||||
@@ -685,5 +660,7 @@ gcal_week_view_init (GcalWeekView *self)
|
|||||||
self->zoom_level = 1.0;
|
self->zoom_level = 1.0;
|
||||||
|
|
||||||
gtk_widget_set_size_request (self->content, -1, HEIGHT_DEFAULT);
|
gtk_widget_set_size_request (self->content, -1, HEIGHT_DEFAULT);
|
||||||
|
|
||||||
|
restore_zoom_level (self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user