appDisplay: Zoom dialog child in and out

Instead of zooming the dialog itself, zoom its only
child, which is the "actual" user-visible dialog.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1301
This commit is contained in:
Georges Basile Stavracas Neto 2020-06-04 22:05:11 -03:00
parent 60d7999b6a
commit d4a947b475

View File

@ -1607,17 +1607,17 @@ var AppFolderDialog = GObject.registerClass({
let [sourceX, sourceY] = let [sourceX, sourceY] =
this._source.get_transformed_position(); this._source.get_transformed_position();
let [dialogX, dialogY] = let [dialogX, dialogY] =
this.get_transformed_position(); this.child.get_transformed_position();
this.set({ this.child.set({
translation_x: sourceX - dialogX, translation_x: sourceX - dialogX,
translation_y: sourceY - dialogY, translation_y: sourceY - dialogY,
scale_x: this._source.width / this.width, scale_x: this._source.width / this.child.width,
scale_y: this._source.height / this.height, scale_y: this._source.height / this.child.height,
opacity: 0, opacity: 0,
}); });
this.ease({ this.child.ease({
translation_x: 0, translation_x: 0,
translation_y: 0, translation_y: 0,
scale_x: 1, scale_x: 1,
@ -1647,18 +1647,18 @@ var AppFolderDialog = GObject.registerClass({
let [sourceX, sourceY] = let [sourceX, sourceY] =
this._source.get_transformed_position(); this._source.get_transformed_position();
let [dialogX, dialogY] = let [dialogX, dialogY] =
this.get_transformed_position(); this.child.get_transformed_position();
this.ease({ this.child.ease({
translation_x: sourceX - dialogX, translation_x: sourceX - dialogX,
translation_y: sourceY - dialogY, translation_y: sourceY - dialogY,
scale_x: this._source.width / this.width, scale_x: this._source.width / this.child.width,
scale_y: this._source.height / this.height, scale_y: this._source.height / this.child.height,
opacity: 0, opacity: 0,
duration: FOLDER_DIALOG_ANIMATION_TIME, duration: FOLDER_DIALOG_ANIMATION_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD, mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: () => { onComplete: () => {
this.set({ this.child.set({
translation_x: 0, translation_x: 0,
translation_y: 0, translation_y: 0,
scale_x: 1, scale_x: 1,