[gnome-shell/gbsneto/icon-grid-part2: 47/48] allView: Scale in when moving icons from folders
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/icon-grid-part2: 47/48] allView: Scale in when moving icons from folders
- Date: Wed, 7 Aug 2019 18:36:01 +0000 (UTC)
commit b8993cde1173921b512d679cc9e493af1881309a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sat Jun 29 14:09:32 2019 -0300
allView: Scale in when moving icons from folders
App icons inside folders are already animated when the folder is
opened, but moving an app icon from a folder doesn't, making the
transition abrupt.
Fortunately, it's easy to detect icons that were previously hidden
but are not anymore.
Add an animation to these icons when showing.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/664
js/ui/appDisplay.js | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 76ba51371..adb488375 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -38,6 +38,9 @@ var VIEWS_SWITCH_ANIMATION_DELAY = 100;
var PAGE_SWITCH_TIME = 300;
+var APP_ICON_SCALE_IN_TIME = 500;
+var APP_ICON_SCALE_IN_DELAY = 700;
+
const SWITCHEROO_BUS_NAME = 'net.hadess.SwitcherooControl';
const SWITCHEROO_OBJECT_PATH = '/net/hadess/SwitcherooControl';
@@ -351,6 +354,8 @@ var AllView = class AllView extends BaseAppView {
}
_refilterApps() {
+ let filteredApps = this._allItems.filter(icon => !icon.actor.visible);
+
this._allItems.forEach(icon => {
if (icon instanceof AppIcon)
icon.actor.visible = true;
@@ -363,6 +368,12 @@ var AllView = class AllView extends BaseAppView {
appIcon.actor.visible = false;
});
});
+
+ // Scale in app icons that weren't visible, but now are
+ filteredApps.filter(icon => icon.actor.visible).forEach(icon => {
+ if (icon instanceof AppIcon)
+ icon.scaleIn();
+ });
}
getAppInfos() {
@@ -1689,6 +1700,7 @@ var AppIcon = class AppIcon {
this.name = app.get_name();
this.actor = new St.Button({ style_class: 'app-well-app',
+ pivot_point: new Clutter.Point({ x: 0.5, y: 0.5 }),
reactive: true,
button_mask: St.ButtonMask.ONE | St.ButtonMask.TWO,
can_focus: true,
@@ -1905,6 +1917,19 @@ var AppIcon = class AppIcon {
this.icon.animateZoomOut();
}
+ scaleIn() {
+ this.actor.scale_x = 0;
+ this.actor.scale_y = 0;
+
+ this.actor.ease({
+ scale_x: 1,
+ scale_y: 1,
+ time: APP_ICON_SCALE_IN_TIME,
+ delay: APP_ICON_SCALE_IN_DELAY,
+ mode: Clutter.AnimationMode.EASE_OUT_QUINT
+ });
+ }
+
shellWorkspaceLaunch(params) {
params = Params.parse(params, { workspace: -1,
timestamp: 0 });
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]