[nautilus/gtk4-preparation-trunk: 34/45] toolbar: Drop theatrics animation on the operations button




commit 8a2883189fbf74f5a817ac85c1e6555d3d8bca2b
Author: António Fernandes <antoniof gnome org>
Date:   Wed Dec 15 14:58:34 2021 +0000

    toolbar: Drop theatrics animation on the operations button
    
    We have been using the copy-pasted code in src/animation to show an
    animation around the operations button when it has just been revealed,
    because CSS animations are clipped by GtkRevealer.
    
    However, this copy-pasted code is burdersome to convert to GTK4, and
    after the conversion we are going to have an easier time animating
    widgets anyway.
    
    So, in order to make the transition easier, take a temporary regression.
    
    This effectively reverts commit 7f8cc0b8892105b24f944ac24248ba3b5f37ecbf,
    but without reintroducing 5ce09ad04b94c4f1652afaa96852437ec40fc934

 src/animation/egg-animation.c    | 1183 --------------------------------------
 src/animation/egg-animation.h    |   74 ---
 src/animation/egg-frame-source.c |  130 -----
 src/animation/egg-frame-source.h |   29 -
 src/animation/ide-box-theatric.c |  417 --------------
 src/animation/ide-box-theatric.h |   30 -
 src/animation/ide-cairo.c        |   84 ---
 src/animation/ide-cairo.h        |   65 ---
 src/meson.build                  |    8 -
 src/nautilus-toolbar.c           |   40 --
 10 files changed, 2060 deletions(-)
---
diff --git a/src/meson.build b/src/meson.build
index a8c650e97..4a11e4ed8 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -54,14 +54,6 @@ libnautilus_sources = [
     interface_prefix: 'org.gnome',
     namespace: 'Nautilus'
   ),
-  'animation/egg-animation.c',
-  'animation/egg-animation.h',
-  'animation/egg-frame-source.c',
-  'animation/egg-frame-source.h',
-  'animation/ide-box-theatric.c',
-  'animation/ide-box-theatric.h',
-  'animation/ide-cairo.c',
-  'animation/ide-cairo.h',
   'gtk/nautilusgtkbookmarksmanager.c',
   'gtk/nautilusgtkbookmarksmanager.h',
   'gtk/nautilusgtkplacessidebar.c',
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c
index c26a4dc95..461cd8627 100644
--- a/src/nautilus-toolbar.c
+++ b/src/nautilus-toolbar.c
@@ -25,9 +25,6 @@
 #include <glib/gi18n.h>
 #include <math.h>
 
-#include "animation/ide-box-theatric.h"
-#include "animation/egg-animation.h"
-
 #include "nautilus-application.h"
 #include "nautilus-bookmark.h"
 #include "nautilus-file-operations.h"
@@ -46,9 +43,6 @@
 #define NEEDS_ATTENTION_ANIMATION_TIMEOUT 2000 /*ms */
 #define REMOVE_FINISHED_OPERATIONS_TIEMOUT 3 /*s */
 
-#define ANIMATION_X_GROW 30
-#define ANIMATION_Y_GROW 30
-
 /* Just design, context at https://gitlab.gnome.org/GNOME/nautilus/issues/548#note_274131 */
 
 typedef enum
@@ -502,40 +496,6 @@ update_operations (NautilusToolbar *self)
         gtk_revealer_set_reveal_child (GTK_REVEALER (self->operations_revealer),
                                        TRUE);
         gtk_widget_queue_draw (self->operations_icon);
-
-        /* Show the popover at start to increase visibility.
-         * Check whether the toolbar is visible or not before showing the
-         * popover. This can happens if the window has the disables-chrome
-         * property set. */
-        if (gtk_widget_is_visible (GTK_WIDGET (self)))
-        {
-            GtkAllocation rect;
-            IdeBoxTheatric *theatric;
-
-            gtk_widget_get_allocation (GTK_WIDGET (self->operations_button), &rect);
-            theatric = g_object_new (IDE_TYPE_BOX_THEATRIC,
-                                     "alpha", 0.9,
-                                     "background", "#fdfdfd",
-                                     "target", self->operations_button,
-                                     "height", rect.height,
-                                     "width", rect.width,
-                                     "x", rect.x,
-                                     "y", rect.y,
-                                     NULL);
-
-            egg_object_animate_full (theatric,
-                                     EGG_ANIMATION_EASE_IN_CUBIC,
-                                     250,
-                                     gtk_widget_get_frame_clock (GTK_WIDGET (self->operations_button)),
-                                     g_object_unref,
-                                     theatric,
-                                     "x", rect.x - ANIMATION_X_GROW,
-                                     "width", rect.width + (ANIMATION_X_GROW * 2),
-                                     "y", rect.y - ANIMATION_Y_GROW,
-                                     "height", rect.height + (ANIMATION_Y_GROW * 2),
-                                     "alpha", 0.0,
-                                     NULL);
-        }
     }
 
     /* Since we removed the info widgets, we need to restore the focus */


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