diff options
author | Ray Strode <rstrode@redhat.com> | 2009-10-30 14:52:04 -0400 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2009-10-30 16:59:36 -0400 |
commit | 6197ec180d369899bf4b87c5e8adaed62ed3fdeb (patch) | |
tree | b7bef3476524ef99d2adde990cede8611b897d6a /gui/simple-greeter/gdm-scrollable-widget.c | |
parent | 3f707bba808b3484be7380a11aebfadb2bc98ab6 (diff) | |
download | gdm-6197ec180d369899bf4b87c5e8adaed62ed3fdeb.tar.gz |
Dynamically slide destination from step function
This lets us add items or swift directions while the animation is going.
Diffstat (limited to 'gui/simple-greeter/gdm-scrollable-widget.c')
-rw-r--r-- | gui/simple-greeter/gdm-scrollable-widget.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/gui/simple-greeter/gdm-scrollable-widget.c b/gui/simple-greeter/gdm-scrollable-widget.c index 2c0407dd..6d9dc834 100644 --- a/gui/simple-greeter/gdm-scrollable-widget.c +++ b/gui/simple-greeter/gdm-scrollable-widget.c @@ -132,9 +132,26 @@ on_animation_tick (GdmScrollableWidgetAnimation *animation, gtk_widget_set_size_request (animation->widget, width, height); if (animation->step_func != NULL) { + GdmTimer *timer; + + height = animation->desired_height; + + height -= animation->widget->style->ythickness * 2; + height -= GTK_CONTAINER (animation->widget)->border_width * 2; + + timer = g_object_ref (animation->timer); animation->step_func (GDM_SCROLLABLE_WIDGET (animation->widget), progress, + &height, animation->step_func_user_data); + + if (gdm_timer_is_started (timer)) { + height += animation->widget->style->ythickness * 2; + height += GTK_CONTAINER (animation->widget)->border_width * 2; + + animation->desired_height = height; + } + g_object_unref (timer); } } @@ -708,7 +725,7 @@ gdm_scrollable_widget_slide_to_height (GdmScrollableWidget *scrollable_widget, if (!input_redirected || gdm_scrollable_widget_animations_are_disabled (scrollable_widget)) { if (step_func != NULL) { - step_func (scrollable_widget, 0.0, step_user_data); + step_func (scrollable_widget, 0.0, &height, step_user_data); } if (done_func != NULL) { |