mirror of
https://github.com/elementary/gala.git
synced 2024-12-30 04:34:17 +03:00
Improve animations
This commit is contained in:
parent
a5d81b1fe4
commit
9ccfdf2687
@ -331,7 +331,7 @@ namespace Gala
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (animate) {
|
if (animate) {
|
||||||
Timeout.add (250, () => {
|
Timeout.add (300, () => {
|
||||||
visible = false;
|
visible = false;
|
||||||
ready = true;
|
ready = true;
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ namespace Gala
|
|||||||
close_button.scale_y = 0.0f;
|
close_button.scale_y = 0.0f;
|
||||||
close_button.scale_gravity = Gravity.CENTER;
|
close_button.scale_gravity = Gravity.CENTER;
|
||||||
close_button.button_press_event.connect (close_clicked);
|
close_button.button_press_event.connect (close_clicked);
|
||||||
|
close_button.leave_event.connect ((e) => leave_event (e));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
close_button.set_from_pixbuf (Granite.Widgets.get_close_pixbuf ());
|
close_button.set_from_pixbuf (Granite.Widgets.get_close_pixbuf ());
|
||||||
@ -90,6 +91,21 @@ namespace Gala
|
|||||||
|
|
||||||
public override bool enter_event (CrossingEvent event)
|
public override bool enter_event (CrossingEvent event)
|
||||||
{
|
{
|
||||||
|
//if we're still animating don't show the close button
|
||||||
|
if (get_animation () != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
close_button.visible = true;
|
||||||
|
close_button.animate (AnimationMode.EASE_OUT_ELASTIC, 400, scale_x : 1.0f, scale_y : 1.0f);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool motion_event (MotionEvent event)
|
||||||
|
{
|
||||||
|
if (get_animation () != null)
|
||||||
|
return false;
|
||||||
|
|
||||||
close_button.visible = true;
|
close_button.visible = true;
|
||||||
close_button.animate (AnimationMode.EASE_OUT_ELASTIC, 400, scale_x : 1.0f, scale_y : 1.0f);
|
close_button.animate (AnimationMode.EASE_OUT_ELASTIC, 400, scale_x : 1.0f, scale_y : 1.0f);
|
||||||
|
|
||||||
@ -134,7 +150,7 @@ namespace Gala
|
|||||||
icon.destroy ();
|
icon.destroy ();
|
||||||
});
|
});
|
||||||
|
|
||||||
animate (AnimationMode.EASE_OUT_CUBIC, 250, scale_x:1.0f, scale_y:1.0f, x:dest_x, y:dest_y).completed.connect (() => {
|
animate (AnimationMode.EASE_IN_OUT_CUBIC, 300, scale_x:1.0f, scale_y:1.0f, x:dest_x, y:dest_y).completed.connect (() => {
|
||||||
(window.get_compositor_private () as Actor).show ();
|
(window.get_compositor_private () as Actor).show ();
|
||||||
destroy ();
|
destroy ();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user