[gedit/wip/dropThreatrics] Drop theatrics and animated overlay and implement new floating slider



commit 85069b8f61fb2a7be0b277ecf5995890602b8392
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Sun Feb 17 14:17:14 2013 +0100

    Drop theatrics and animated overlay and implement new floating slider

 configure.ac                                       |    1 -
 gedit/Makefile.am                                  |    7 -
 gedit/gedit-animatable.c                           |  103 ------
 gedit/gedit-animatable.h                           |   57 ---
 gedit/gedit-animated-overlay.c                     |  172 ---------
 gedit/gedit-animated-overlay.h                     |   64 ----
 gedit/gedit-floating-slider.c                      |  372 ++++++++++++--------
 gedit/gedit-floating-slider.h                      |    7 +-
 gedit/gedit-view-frame.c                           |   37 +--
 gedit/theatrics/Makefile.am                        |   52 ---
 gedit/theatrics/gedit-theatrics-actor.c            |  279 ---------------
 gedit/theatrics/gedit-theatrics-actor.h            |   90 -----
 gedit/theatrics/gedit-theatrics-choreographer.c    |   85 -----
 gedit/theatrics/gedit-theatrics-choreographer.h    |   74 ----
 .../gedit-theatrics-enum-types.c.template          |   39 --
 .../gedit-theatrics-enum-types.h.template          |   27 --
 gedit/theatrics/gedit-theatrics-marshal.list       |    1 -
 gedit/theatrics/gedit-theatrics-stage.c            |  310 ----------------
 gedit/theatrics/gedit-theatrics-stage.h            |   87 -----
 gedit/theatrics/gedit-theatrics-utils.c            |  131 -------
 gedit/theatrics/gedit-theatrics-utils.h            |   48 ---
 libgd                                              |    2 +-
 22 files changed, 242 insertions(+), 1803 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 0290eeb..a4d7ea8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -444,7 +444,6 @@ data/org.gnome.gedit.gschema.xml.in
 data/Makefile
 docs/Makefile
 docs/reference/Makefile
-gedit/theatrics/Makefile
 gedit/Makefile
 help/Makefile
 libgd/Makefile
diff --git a/gedit/Makefile.am b/gedit/Makefile.am
index ff028d6..c301e0f 100644
--- a/gedit/Makefile.am
+++ b/gedit/Makefile.am
@@ -1,6 +1,4 @@
 ## Process this file with automake to produce Makefile.in
-SUBDIRS = theatrics
-
 bin_PROGRAMS = gedit
 
 noinst_LTLIBRARIES = libgedit.la
@@ -38,7 +36,6 @@ endif
 libgedit_la_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*"
 
 libgedit_la_LIBADD = \
-       theatrics/libtheatrics.la \
        $(top_builddir)/libgd/libgd.la
 
 # GEDIT_LIBS must be the last to ensure correct order on some platforms
@@ -99,8 +96,6 @@ BUILT_SOURCES =                       \
        gedit-marshal.h
 
 NOINST_H_FILES =                       \
-       gedit-animatable.h              \
-       gedit-animated-overlay.h        \
        gedit-cell-renderer-button.h    \
        gedit-close-button.h            \
        gedit-close-confirmation-dialog.h \
@@ -171,8 +166,6 @@ libgedit_private_la_SOURCES =               \
        gedit-resources.c
 
 libgedit_c_files =                     \
-       gedit-animatable.c              \
-       gedit-animated-overlay.c        \
        gedit-app.c                     \
        gedit-cell-renderer-button.c    \
        gedit-close-button.c            \
diff --git a/gedit/gedit-floating-slider.c b/gedit/gedit-floating-slider.c
index ba2eeb3..e3ff254 100644
--- a/gedit/gedit-floating-slider.c
+++ b/gedit/gedit-floating-slider.c
@@ -22,20 +22,24 @@
  * Boston, MA  02110-1301  USA
  */
 
+#include <math.h>
+
 #include "gedit-floating-slider.h"
-#include "gedit-animatable.h"
 
 struct _GeditFloatingSliderPrivate
 {
        GtkAllocation widget_alloc;
        GtkAllocation child_alloc;
-       GeditTheatricsChoreographerEasing easing;
-       GeditTheatricsChoreographerBlocking blocking;
-       GeditTheatricsAnimationState animation_state;
        GtkOrientation orientation;
-       guint duration;
-       gdouble bias;
-       gdouble percent;
+       guint tick_id;
+       gint duration;
+
+       gdouble current_pos;
+       gdouble source_pos;
+       gdouble target_pos;
+
+       gint64 start_time;
+       gint64 end_time;
 };
 
 struct _GeditFloatingSliderClassPrivate
@@ -46,25 +50,27 @@ struct _GeditFloatingSliderClassPrivate
 enum
 {
        PROP_0,
-       PROP_EASING,
-       PROP_BLOCKING,
-       PROP_ANIMATION_STATE,
+       PROP_SLIDED,
        PROP_DURATION,
-       PROP_PERCENT,
-       PROP_BIAS,
        PROP_ORIENTATION
 };
 
 G_DEFINE_TYPE_WITH_CODE (GeditFloatingSlider, gedit_floating_slider, GTK_TYPE_BIN,
                          g_type_add_class_private (g_define_type_id, sizeof 
(GeditFloatingSliderClassPrivate));
-                         G_IMPLEMENT_INTERFACE (GEDIT_TYPE_ANIMATABLE,
-                                                NULL)
                          G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE,
                                                 NULL))
 
 static void
 gedit_floating_slider_finalize (GObject *object)
 {
+       GeditFloatingSliderPrivate *priv = GEDIT_FLOATING_SLIDER (object)->priv;
+
+       if (priv->tick_id != 0)
+       {
+               gtk_widget_remove_tick_callback (GTK_WIDGET (object), priv->tick_id);
+               priv->tick_id = 0;
+       }
+
        G_OBJECT_CLASS (gedit_floating_slider_parent_class)->finalize (object);
 }
 
@@ -78,23 +84,11 @@ gedit_floating_slider_get_property (GObject    *object,
 
        switch (prop_id)
        {
-               case PROP_EASING:
-                       g_value_set_enum (value, priv->easing);
-                       break;
-               case PROP_BLOCKING:
-                       g_value_set_enum (value, priv->blocking);
-                       break;
-               case PROP_ANIMATION_STATE:
-                       g_value_set_enum (value, priv->animation_state);
+               case PROP_SLIDED:
+                       g_value_set_boolean (value, FALSE);
                        break;
                case PROP_DURATION:
-                       g_value_set_uint (value, priv->duration);
-                       break;
-               case PROP_PERCENT:
-                       g_value_set_double (value, priv->percent);
-                       break;
-               case PROP_BIAS:
-                       g_value_set_double (value, priv->bias);
+                       g_value_set_int (value, priv->duration);
                        break;
                case PROP_ORIENTATION:
                        g_value_set_enum (value, priv->orientation);
@@ -115,34 +109,8 @@ gedit_floating_slider_set_property (GObject      *object,
 
        switch (prop_id)
        {
-               case PROP_EASING:
-                       priv->easing = g_value_get_enum (value);
-                       break;
-               case PROP_BLOCKING:
-                       priv->blocking = g_value_get_enum (value);
-                       break;
-               case PROP_ANIMATION_STATE:
-                       priv->animation_state = g_value_get_enum (value);
-                       break;
                case PROP_DURATION:
-                       priv->duration = g_value_get_uint (value);
-                       break;
-               case PROP_PERCENT:
-                       priv->percent = g_value_get_double (value);
-                       gtk_widget_queue_resize_no_redraw (GTK_WIDGET (object));
-
-                       /* Make the widget visibility automagic */
-                       if (priv->percent > 0 && !gtk_widget_get_visible (GTK_WIDGET (object)))
-                       {
-                               gtk_widget_show (GTK_WIDGET (object));
-                       }
-                       else if (priv->percent == 0 && gtk_widget_get_visible (GTK_WIDGET (object)))
-                       {
-                               gtk_widget_hide (GTK_WIDGET (object));
-                       }
-                       break;
-               case PROP_BIAS:
-                       priv->bias = g_value_get_double (value);
+                       priv->duration = g_value_get_int (value);
                        break;
                case PROP_ORIENTATION:
                        priv->orientation = g_value_get_enum (value);
@@ -153,47 +121,53 @@ gedit_floating_slider_set_property (GObject      *object,
        }
 }
 
+static gint
+pixel_compose (gdouble percent,
+               gint    size)
+{
+       gdouble compose;
+
+       percent *= 2.0;
+       compose = percent < 1.0 ? 0.5 * pow (2.0, 10.0 * (percent - 1.0))
+                               : 0.5 * (-pow (2.0, -10.0 * (percent - 1.0)) + 2.0);
+
+       return (gint)round (size * compose);
+}
+
 static void
 gedit_floating_slider_get_preferred_width (GtkWidget *widget,
                                            gint      *minimum,
                                            gint      *natural)
 {
        GeditFloatingSliderPrivate *priv = GEDIT_FLOATING_SLIDER (widget)->priv;
-       GtkWidget *child;
-       gint width;
-
-       child = gtk_bin_get_child (GTK_BIN (widget));
-
-       if (child != NULL)
-       {
-               GtkStyleContext *context;
-               GtkBorder padding;
-               gint child_min, child_nat;
-
-               gtk_widget_get_preferred_width (child, &child_min, &child_nat);
+       GtkStyleContext *context;
+       GtkBorder padding;
+       gint minimum_width;
+       gint natural_width;
 
-               priv->child_alloc.width = child_nat;
+       GTK_WIDGET_CLASS (gedit_floating_slider_parent_class)->get_preferred_width (widget, &minimum_width, 
&natural_width);
 
-               context = gtk_widget_get_style_context (widget);
-               gtk_style_context_get_padding (context, GTK_STATE_FLAG_NORMAL,
-                                              &padding);
+       context = gtk_widget_get_style_context (widget);
+       gtk_style_context_get_padding (context, GTK_STATE_FLAG_NORMAL,
+                                      &padding);
+       natural_width += padding.left + padding.right;
 
-               priv->widget_alloc.width = child_nat + padding.left + padding.right;
+       if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+       {
+               natural_width = pixel_compose (priv->current_pos, natural_width);
        }
 
+       minimum_width = natural_width;
 
-       if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+       if (minimum)
        {
-               width = gedit_theatrics_choreographer_pixel_compose (priv->percent,
-                                                                    priv->widget_alloc.width,
-                                                                    priv->easing);
+               *minimum = minimum_width;
        }
-       else
+
+       if (natural)
        {
-               width = priv->widget_alloc.width;
+               *natural = natural_width;
        }
-
-       *minimum = *natural = width;
 }
 
 static void
@@ -202,40 +176,34 @@ gedit_floating_slider_get_preferred_height (GtkWidget *widget,
                                             gint      *natural)
 {
        GeditFloatingSliderPrivate *priv = GEDIT_FLOATING_SLIDER (widget)->priv;
-       GtkWidget *child;
-       gint height;
-
-       child = gtk_bin_get_child (GTK_BIN (widget));
-
-       if (child != NULL)
-       {
-               GtkStyleContext *context;
-               GtkBorder padding;
-               gint child_min, child_nat;
-
-               gtk_widget_get_preferred_height (child, &child_min, &child_nat);
+       GtkStyleContext *context;
+       GtkBorder padding;
+       gint minimum_height;
+       gint natural_height;
 
-               priv->child_alloc.height = child_nat;
+       GTK_WIDGET_CLASS (gedit_floating_slider_parent_class)->get_preferred_height (widget, &minimum_height, 
&natural_height);
 
-               context = gtk_widget_get_style_context (widget);
-               gtk_style_context_get_padding (context, GTK_STATE_FLAG_NORMAL,
-                                              &padding);
+       context = gtk_widget_get_style_context (widget);
+       gtk_style_context_get_padding (context, GTK_STATE_FLAG_NORMAL,
+                                      &padding);
+       natural_height += padding.top + padding.bottom;
 
-               priv->widget_alloc.height = child_nat + padding.top + padding.bottom;
+       if (priv->orientation == GTK_ORIENTATION_VERTICAL)
+       {
+               natural_height = pixel_compose (priv->current_pos, natural_height);
        }
 
-       if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
+       minimum_height = natural_height;
+
+       if (minimum)
        {
-               height = priv->widget_alloc.height;
+               *minimum = minimum_height;
        }
-       else
+
+       if (natural)
        {
-               height = gedit_theatrics_choreographer_pixel_compose (priv->percent,
-                                                                     priv->widget_alloc.height,
-                                                                     priv->easing);
+               *natural = natural_height;
        }
-
-       *minimum = *natural = height;
 }
 
 static void
@@ -245,11 +213,17 @@ gedit_floating_slider_size_allocate (GtkWidget     *widget,
        GeditFloatingSliderPrivate *priv = GEDIT_FLOATING_SLIDER (widget)->priv;
        GtkWidget *child;
 
+       // FIXME: this is kinda hacky
+       if (allocation->width <= 1 || allocation->height <= 1)
+       {
+               return;
+       }
+       
        GTK_WIDGET_CLASS (gedit_floating_slider_parent_class)->size_allocate (widget, allocation);
 
        child = gtk_bin_get_child (GTK_BIN (widget));
 
-       if (child != NULL)
+       if (child != NULL && gtk_widget_get_visible (child))
        {
                GtkStyleContext *context;
                GtkBorder padding;
@@ -259,28 +233,10 @@ gedit_floating_slider_size_allocate (GtkWidget     *widget,
                gtk_style_context_get_padding (context, GTK_STATE_FLAG_NORMAL,
                                               &padding);
 
-               child_alloc = priv->child_alloc;
-
-               if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
-               {
-                       child_alloc.y = padding.top;
-                       child_alloc.x = padding.left;
-
-                       if (priv->blocking == GEDIT_THEATRICS_CHOREOGRAPHER_BLOCKING_DOWNSTAGE)
-                       {
-                               child_alloc.x = allocation->width - priv->child_alloc.width - padding.right;
-                       }
-               }
-               else
-               {
-                       child_alloc.y = padding.top;
-                       child_alloc.x = padding.left;
-
-                       if (priv->blocking == GEDIT_THEATRICS_CHOREOGRAPHER_BLOCKING_DOWNSTAGE)
-                       {
-                               child_alloc.y = allocation->height - priv->child_alloc.height - 
padding.bottom;
-                       }
-               }
+               child_alloc.width = allocation->width - (padding.left + padding.right);
+               child_alloc.height = allocation->height - (padding.top + padding.bottom);
+               child_alloc.y = padding.top;
+               child_alloc.x = padding.left;
 
                if (child_alloc.height > 0 && child_alloc.width > 0)
                {
@@ -340,23 +296,20 @@ gedit_floating_slider_class_init (GeditFloatingSliderClass *klass)
        widget_class->size_allocate = gedit_floating_slider_size_allocate;
        widget_class->draw = gedit_floating_slider_draw;
 
-       g_object_class_override_property (object_class, PROP_EASING,
-                                         "easing");
-
-       g_object_class_override_property (object_class, PROP_BLOCKING,
-                                         "blocking");
-
-       g_object_class_override_property (object_class, PROP_ANIMATION_STATE,
-                                         "animation-state");
-
-       g_object_class_override_property (object_class, PROP_DURATION,
-                                         "duration");
-
-       g_object_class_override_property (object_class, PROP_PERCENT,
-                                         "percent");
-
-       g_object_class_override_property (object_class, PROP_BIAS,
-                                         "bias");
+       g_object_class_install_property (object_class,
+                                        PROP_SLIDED,
+                                        g_param_spec_boolean ("slided", "Slided",
+                                                              "Whether the animation target reached",
+                                                              FALSE,
+                                                              G_PARAM_READABLE));
+
+       g_object_class_install_property (object_class,
+                                        PROP_DURATION,
+                                        g_param_spec_int ("duration", "duration",
+                                                          "The animation duration, in milliseconds",
+                                                          G_MININT, G_MAXINT,
+                                                          300,
+                                                          G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
 
        g_object_class_override_property (object_class, PROP_ORIENTATION,
                                          "orientation");
@@ -380,6 +333,7 @@ gedit_floating_slider_init (GeditFloatingSlider *slider)
                                                    GeditFloatingSliderPrivate);
 
        slider->priv->orientation = GTK_ORIENTATION_VERTICAL;
+       slider->priv->duration = 300;
 
        context = gtk_widget_get_style_context (GTK_WIDGET (slider));
        gtk_style_context_add_provider (context,
@@ -387,10 +341,136 @@ gedit_floating_slider_init (GeditFloatingSlider *slider)
                                        GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
 }
 
+static void
+set_position (GeditFloatingSlider *slider,
+              gdouble              pos)
+{
+       GeditFloatingSliderPrivate *priv = slider->priv;
+       GtkWidget *child;
+
+       priv->current_pos = pos;
+
+       if (priv->current_pos == priv->target_pos)
+       {
+               g_object_notify (G_OBJECT (slider), "slided");
+       }
+
+       child = gtk_bin_get_child (GTK_BIN (slider));
+       if (child)
+       {
+               gtk_widget_set_visible (child, priv->current_pos > 0.1);
+       }
+       gtk_widget_queue_resize (GTK_WIDGET (slider));
+}
+
+static gdouble
+ease_out_quad (gdouble t, gdouble d)
+{
+  gdouble p = t / d;
+  return  ((-1.0) * p) * (p - 2);
+}
+
+static void
+animate_step (GeditFloatingSlider *slider,
+              gint64               now)
+{
+       GeditFloatingSliderPrivate *priv = slider->priv;
+       gdouble t;
+
+       t = 1.0;
+       if (now < priv->end_time)
+       {
+               t = (now - priv->start_time) / (double) (priv->end_time - priv->start_time);
+       }
+       t = ease_out_quad (t, 1.0);
+
+       set_position (slider,
+                     priv->source_pos + (t * (priv->target_pos - priv->source_pos)));
+}
+
+static gboolean
+animate_cb (GeditFloatingSlider *slider,
+            GdkFrameClock       *frame_clock,
+            gpointer             user_data)
+{
+       GeditFloatingSliderPrivate *priv = slider->priv;
+       gint64 now;
+
+       now = gdk_frame_clock_get_frame_time (frame_clock);
+       animate_step (slider, now);
+       if (priv->current_pos == priv->target_pos)
+       {
+               priv->tick_id = 0;
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+static void
+start_animation (GeditFloatingSlider *slider,
+                 gdouble              target)
+{
+       GeditFloatingSliderPrivate *priv = slider->priv;
+
+       if (priv->target_pos == target)
+       {
+               return;
+       }
+
+       priv->target_pos = target;
+
+       if (gtk_widget_get_mapped (GTK_WIDGET (slider)))
+       {
+               priv->source_pos = priv->current_pos;
+               priv->start_time = gdk_frame_clock_get_frame_time (gtk_widget_get_frame_clock (GTK_WIDGET 
(slider)));
+               priv->end_time = priv->start_time + (priv->duration * 1000);
+               if (priv->tick_id == 0)
+               {
+                       priv->tick_id =
+                               gtk_widget_add_tick_callback (GTK_WIDGET (slider), 
(GtkTickCallback)animate_cb,
+                                                             NULL, NULL);
+               }
+
+               animate_step (slider, priv->start_time);
+       }
+       else
+       {
+               set_position (slider, target);
+       }
+}
+
 GtkWidget *
 gedit_floating_slider_new (void)
 {
        return g_object_new (GEDIT_TYPE_FLOATING_SLIDER, NULL);
 }
 
+void
+gedit_floating_slider_slide_in (GeditFloatingSlider *slider)
+{
+       g_return_if_fail (GEDIT_IS_FLOATING_SLIDER (slider));
+
+       start_animation (slider, 1.0);
+}
+
+void
+gedit_floating_slider_slide_out (GeditFloatingSlider *slider)
+{
+       g_return_if_fail (GEDIT_IS_FLOATING_SLIDER (slider));
+
+       start_animation (slider, 0.0);
+}
+
+gboolean
+gedit_floating_slider_get_slided (GeditFloatingSlider *slider)
+{
+       g_return_val_if_fail (GEDIT_IS_FLOATING_SLIDER (slider), FALSE);
+
+       gboolean slided;
+       g_object_get (G_OBJECT (slider), "slided", &slided, NULL);
+       
+       return slided;
+}
+
 /* ex:set ts=8 noet: */
diff --git a/gedit/gedit-floating-slider.h b/gedit/gedit-floating-slider.h
index 3da4e65..ebf85d6 100644
--- a/gedit/gedit-floating-slider.h
+++ b/gedit/gedit-floating-slider.h
@@ -27,7 +27,6 @@
 
 #include <glib-object.h>
 #include <gtk/gtk.h>
-#include "theatrics/gedit-theatrics-choreographer.h"
 
 G_BEGIN_DECLS
 
@@ -62,6 +61,12 @@ GType                 gedit_floating_slider_get_type (void) G_GNUC_CONST;
 
 GtkWidget      *gedit_floating_slider_new      (void);
 
+void             gedit_floating_slider_slide_in (GeditFloatingSlider *slider);
+
+void             gedit_floating_slider_slide_out (GeditFloatingSlider *slider);
+
+gboolean         gedit_floating_slider_get_slided (GeditFloatingSlider *slider);
+
 G_END_DECLS
 
 #endif /* __GEDIT_FLOATING_SLIDER_H__ */
diff --git a/gedit/gedit-view-frame.c b/gedit/gedit-view-frame.c
index 2b72967..cf4ce7d 100644
--- a/gedit/gedit-view-frame.c
+++ b/gedit/gedit-view-frame.c
@@ -28,7 +28,6 @@
 #include "gedit-marshal.h"
 #include "gedit-debug.h"
 #include "gedit-utils.h"
-#include "gedit-animated-overlay.h"
 #include "gedit-floating-slider.h"
 
 #include <gdk/gdkkeysyms.h>
@@ -173,10 +172,7 @@ hide_search_widget (GeditViewFrame *frame,
                frame->priv->typeselect_flush_timeout = 0;
        }
 
-       /* To hide the slider we just set the animation-state property */
-       g_object_set (G_OBJECT (frame->priv->slider),
-                     "animation-state", GEDIT_THEATRICS_ANIMATION_STATE_INTENDING_TO_GO,
-                     NULL);
+       gedit_floating_slider_slide_out (GEDIT_FLOATING_SLIDER (frame->priv->slider));
 
        if (cancel)
        {
@@ -1107,13 +1103,7 @@ start_interactive_search_real (GeditViewFrame *frame)
        GtkTextIter iter;
        GtkTextMark *mark;
 
-       if (gtk_bin_get_child (GTK_BIN (frame->priv->slider)) == NULL)
-       {
-               gtk_container_add (GTK_CONTAINER (frame->priv->slider),
-                                  create_search_widget (frame));
-       }
-
-       if (gtk_widget_get_visible (frame->priv->slider))
+       if (gedit_floating_slider_get_slided (GEDIT_FLOATING_SLIDER (frame->priv->slider)))
        {
                if (frame->priv->search_mode != frame->priv->request_search_mode)
                {
@@ -1161,10 +1151,7 @@ start_interactive_search_real (GeditViewFrame *frame)
        frame->priv->start_mark = gtk_text_buffer_create_mark (buffer, NULL,
                                                               &iter, FALSE);
 
-       /* To slide in we set the right animation state in the animatable */
-       g_object_set (G_OBJECT (frame->priv->slider),
-                     "animation-state", GEDIT_THEATRICS_ANIMATION_STATE_COMING,
-                     NULL);
+       gedit_floating_slider_slide_in (GEDIT_FLOATING_SLIDER (frame->priv->slider));
 
        /* NOTE: we must be very careful here to not have any text before
           focusing the entry because when the entry is focused the text is
@@ -1263,16 +1250,13 @@ gedit_view_frame_init (GeditViewFrame *frame)
 
        /* Create the scrolled window */
        sw = gtk_scrolled_window_new (NULL, NULL);
-
        gtk_container_add (GTK_CONTAINER (sw), frame->priv->view);
-
        gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
                                        GTK_POLICY_AUTOMATIC,
                                        GTK_POLICY_AUTOMATIC);
-
        gtk_widget_show (sw);
 
-       frame->priv->overlay = gedit_animated_overlay_new ();
+       frame->priv->overlay = gtk_overlay_new ();
        gtk_container_add (GTK_CONTAINER (frame->priv->overlay), sw);
        gtk_widget_override_background_color (frame->priv->overlay, 0, &transparent);
        gtk_widget_show (frame->priv->overlay);
@@ -1281,6 +1265,9 @@ gedit_view_frame_init (GeditViewFrame *frame)
 
        /* Add slider */
        frame->priv->slider = gedit_floating_slider_new ();
+       gtk_container_add (GTK_CONTAINER (frame->priv->slider),
+                          create_search_widget (frame));
+       gtk_widget_show (frame->priv->slider);
        gtk_widget_set_name (frame->priv->slider, "search-slider");
        gtk_widget_set_halign (frame->priv->slider, GTK_ALIGN_END);
        gtk_widget_set_valign (frame->priv->slider, GTK_ALIGN_START);
@@ -1294,14 +1281,8 @@ gedit_view_frame_init (GeditViewFrame *frame)
                gtk_widget_set_margin_left (frame->priv->slider, SEARCH_POPUP_MARGIN);
        }
 
-       g_object_set (G_OBJECT (frame->priv->slider),
-                     "easing", GEDIT_THEATRICS_CHOREOGRAPHER_EASING_EXPONENTIAL_IN_OUT,
-                     "blocking", GEDIT_THEATRICS_CHOREOGRAPHER_BLOCKING_DOWNSTAGE,
-                     "orientation", GTK_ORIENTATION_VERTICAL,
-                     NULL);
-
-       gedit_animated_overlay_add_animated_overlay (GEDIT_ANIMATED_OVERLAY (frame->priv->overlay),
-                                                    GEDIT_ANIMATABLE (frame->priv->slider));
+       gtk_overlay_add_overlay (GTK_OVERLAY (frame->priv->overlay),
+                                frame->priv->slider);
 }
 
 GeditViewFrame *
diff --git a/libgd b/libgd
index 25911b0..50c03b3 160000
--- a/libgd
+++ b/libgd
@@ -1 +1 @@
-Subproject commit 25911b0068b78cd425f0f405eae9b5654699dd2f
+Subproject commit 50c03b305321e027630f97aef17a74434d9b8980


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