subscriber-view: use ::setup_child protected func
This commit is contained in:
@@ -219,7 +219,7 @@ event_opened (GcalEventWidget *event_widget,
|
|||||||
priv = gcal_month_view_get_instance_private (GCAL_MONTH_VIEW (user_data));
|
priv = gcal_month_view_get_instance_private (GCAL_MONTH_VIEW (user_data));
|
||||||
|
|
||||||
gtk_widget_hide (priv->overflow_popover);
|
gtk_widget_hide (priv->overflow_popover);
|
||||||
g_signal_emit_by_name (GCAL_VIEW (user_data), "event-activated", event_widget);
|
g_signal_emit_by_name (GCAL_SUBSCRIBER_VIEW (user_data), "event-activated", event_widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@@ -32,6 +32,9 @@ enum
|
|||||||
|
|
||||||
static guint signals[NUM_SIGNALS] = { 0, };
|
static guint signals[NUM_SIGNALS] = { 0, };
|
||||||
|
|
||||||
|
static void event_activated (GcalEventWidget *widget,
|
||||||
|
gpointer user_data);
|
||||||
|
|
||||||
static void gcal_data_model_subscriber_interface_init (ECalDataModelSubscriberInterface *iface);
|
static void gcal_data_model_subscriber_interface_init (ECalDataModelSubscriberInterface *iface);
|
||||||
|
|
||||||
static void gcal_subscriber_view_finalize (GObject *object);
|
static void gcal_subscriber_view_finalize (GObject *object);
|
||||||
@@ -75,6 +78,13 @@ G_DEFINE_TYPE_WITH_CODE (GcalSubscriberView, gcal_subscriber_view, GTK_TYPE_CONT
|
|||||||
G_IMPLEMENT_INTERFACE (E_TYPE_CAL_DATA_MODEL_SUBSCRIBER,
|
G_IMPLEMENT_INTERFACE (E_TYPE_CAL_DATA_MODEL_SUBSCRIBER,
|
||||||
gcal_data_model_subscriber_interface_init));
|
gcal_data_model_subscriber_interface_init));
|
||||||
|
|
||||||
|
static void
|
||||||
|
event_activated (GcalEventWidget *widget,
|
||||||
|
gpointer user_data)
|
||||||
|
{
|
||||||
|
/* FIXME: clear_widget marks + popover + any state */
|
||||||
|
g_signal_emit (GCAL_SUBSCRIBER_VIEW (user_data), signals[EVENT_ACTIVATED], 0, widget);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gcal_subscriber_view_class_init (GcalSubscriberViewClass *klass)
|
gcal_subscriber_view_class_init (GcalSubscriberViewClass *klass)
|
||||||
@@ -181,9 +191,7 @@ gcal_subscriber_view_add (GtkContainer *container,
|
|||||||
g_hash_table_insert (priv->single_cell_children, GINT_TO_POINTER (cell_idx), l);
|
g_hash_table_insert (priv->single_cell_children, GINT_TO_POINTER (cell_idx), l);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* setup child */
|
_gcal_subscriber_view_setup_child (GCAL_SUBSCRIBER_VIEW (container), widget);
|
||||||
gtk_widget_set_parent (widget, GTK_WIDGET (container));
|
|
||||||
//g_signal_connect (widget, "activate", G_CALLBACK (event_opened), container);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -429,3 +437,11 @@ gcal_subscriber_view_get_child_by_uuid (GcalSubscriberView *subscriber_view,
|
|||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
_gcal_subscriber_view_setup_child (GcalSubscriberView *subscriber_view,
|
||||||
|
GtkWidget *child_widget)
|
||||||
|
{
|
||||||
|
gtk_widget_set_parent (child_widget, GTK_WIDGET (subscriber_view));
|
||||||
|
g_signal_connect (child_widget, "activate", G_CALLBACK (event_activated), subscriber_view);
|
||||||
|
}
|
||||||
|
|||||||
@@ -65,6 +65,10 @@ GType gcal_subscriber_view_get_type (void);
|
|||||||
GtkWidget* gcal_subscriber_view_get_child_by_uuid (GcalSubscriberView *subscriber_view,
|
GtkWidget* gcal_subscriber_view_get_child_by_uuid (GcalSubscriberView *subscriber_view,
|
||||||
const gchar *uuid);
|
const gchar *uuid);
|
||||||
|
|
||||||
|
/* protected */
|
||||||
|
void _gcal_subscriber_view_setup_child (GcalSubscriberView *subscriber_view,
|
||||||
|
GtkWidget *child_widget);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GCAL_SUBSCRIBER_VIEW_H__ */
|
#endif /* __GCAL_SUBSCRIBER_VIEW_H__ */
|
||||||
|
|||||||
+1
-14
@@ -52,9 +52,6 @@ enum
|
|||||||
PROP_MANAGER //manager inherited property
|
PROP_MANAGER //manager inherited property
|
||||||
};
|
};
|
||||||
|
|
||||||
static void event_opened (GcalEventWidget *event_widget,
|
|
||||||
gpointer user_data);
|
|
||||||
|
|
||||||
static gboolean get_widget_parts (gint first_cell,
|
static gboolean get_widget_parts (gint first_cell,
|
||||||
gint last_cell,
|
gint last_cell,
|
||||||
gint natural_height,
|
gint natural_height,
|
||||||
@@ -124,15 +121,6 @@ G_DEFINE_TYPE_WITH_CODE (GcalYearView, gcal_year_view, GCAL_TYPE_SUBSCRIBER_VIEW
|
|||||||
G_IMPLEMENT_INTERFACE (GCAL_TYPE_VIEW,gcal_view_interface_init));
|
G_IMPLEMENT_INTERFACE (GCAL_TYPE_VIEW,gcal_view_interface_init));
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
event_opened (GcalEventWidget *event_widget,
|
|
||||||
gpointer user_data)
|
|
||||||
{
|
|
||||||
g_signal_emit_by_name (GCAL_VIEW (user_data),
|
|
||||||
"event-activated",
|
|
||||||
event_widget);
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
get_widget_parts (gint first_cell,
|
get_widget_parts (gint first_cell,
|
||||||
gint last_cell,
|
gint last_cell,
|
||||||
@@ -551,8 +539,7 @@ gcal_year_view_size_allocate (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
child_widget = gcal_event_widget_clone (GCAL_EVENT_WIDGET (child_widget));
|
child_widget = gcal_event_widget_clone (GCAL_EVENT_WIDGET (child_widget));
|
||||||
|
|
||||||
//setup_child (child_widget, widget);
|
_gcal_subscriber_view_setup_child (GCAL_SUBSCRIBER_VIEW (widget), child_widget);
|
||||||
gtk_widget_set_parent (child_widget, widget); /* FIXME */
|
|
||||||
gtk_widget_show (child_widget);
|
gtk_widget_show (child_widget);
|
||||||
|
|
||||||
aux = g_hash_table_lookup (ppriv->children, uuid);
|
aux = g_hash_table_lookup (ppriv->children, uuid);
|
||||||
|
|||||||
Reference in New Issue
Block a user