Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions bge/bge-carousel.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,36 @@ bge_carousel_size_allocate (GtkWidget *widget,
}
}

static void
bge_carousel_map (GtkWidget *widget)
{
BgeCarousel *self = NULL;
guint selected = 0;

self = BGE_CAROUSEL (widget);

GTK_WIDGET_CLASS (bge_carousel_parent_class)->map (widget);

if (self->model != NULL)
{
selected = gtk_single_selection_get_selected (self->model);
if (selected != G_MAXUINT)
{
for (guint i = 0; i < self->widgets->len; i++)
{
CarouselWidgetData *child = NULL;

child = g_ptr_array_index (self->widgets, i);
if (child->cancellable != NULL)
g_cancellable_cancel (child->cancellable);
child->target = child->rect;
}
}
}

gtk_widget_queue_allocate (GTK_WIDGET (self));
}

static void
bge_carousel_class_init (BgeCarouselClass *klass)
{
Expand Down Expand Up @@ -466,6 +496,7 @@ bge_carousel_class_init (BgeCarouselClass *klass)

widget_class->measure = bge_carousel_measure;
widget_class->size_allocate = bge_carousel_size_allocate;
widget_class->map = bge_carousel_map;
}

static void
Expand Down Expand Up @@ -1378,3 +1409,4 @@ finish_horizontal_gesture (BgeCarousel *self,
}

/* End of bge-carousel.c */

Loading