Skip to content

Commit f6748bf

Browse files
committed
Use PropertyAnimator for show_tile_preview
1 parent a03cdbe commit f6748bf

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/WindowManager.vala

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -976,24 +976,24 @@ namespace Gala {
976976
unowned Meta.WindowActor window_actor = window.get_compositor_private () as Meta.WindowActor;
977977
window_group.set_child_below_sibling (tile_preview, window_actor);
978978

979-
var duration = AnimationDuration.SNAP / 2U;
980-
981979
var rect = window.get_frame_rect ();
982980
tile_preview.set_position (rect.x, rect.y);
983981
tile_preview.set_size (rect.width, rect.height);
984982
tile_preview.show ();
985983

986-
if (Meta.Prefs.get_gnome_animations ()) {
987-
tile_preview.save_easing_state ();
988-
tile_preview.set_easing_mode (Clutter.AnimationMode.EASE_IN_OUT_QUAD);
989-
tile_preview.set_easing_duration (duration);
990-
tile_preview.opacity = 255U;
991-
tile_preview.set_position (tile_rect.x, tile_rect.y);
992-
tile_preview.set_size (tile_rect.width, tile_rect.height);
993-
tile_preview.restore_easing_state ();
994-
} else {
995-
tile_preview.opacity = 255U;
996-
}
984+
new PropertyAnimator (
985+
tile_preview,
986+
AnimationDuration.SNAP / 2,
987+
Clutter.AnimationMode.EASE_IN_OUT_QUAD,
988+
{
989+
{ "opacity", typeof (uint), null, 255u },
990+
{ "x", typeof (float), null, (float) tile_rect.x },
991+
{ "y", typeof (float), null, (float) tile_rect.y },
992+
{ "width", typeof (float), null, (float) tile_rect.width },
993+
{ "height", typeof (float), null, (float) tile_rect.height }
994+
},
995+
() => {}
996+
);
997997
}
998998

999999
public override void hide_tile_preview () {

0 commit comments

Comments
 (0)