mirror of
https://github.com/elementary/gala.git
synced 2024-12-30 12:48:36 +03:00
Fix merge
This commit is contained in:
parent
72bc8b9428
commit
2ba0b1d4cb
@ -10,7 +10,7 @@
|
||||
* with easing without a gesture. Respects the enable animation setting.
|
||||
*/
|
||||
public class Gala.GesturePropertyTransition : Object {
|
||||
public delegate void DoneCallback (bool cancel_action);
|
||||
public delegate void DoneCallback (int completions);
|
||||
|
||||
/**
|
||||
* The actor whose property will be animated.
|
||||
@ -100,13 +100,13 @@ public class Gala.GesturePropertyTransition : Object {
|
||||
|
||||
if (actual_from_value.type () != current_value.type ()) {
|
||||
warning ("from_value of type %s is not of the same type as the property %s which is %s. Can't animate.", from_value.type_name (), property, current_value.type_name ());
|
||||
finish (true);
|
||||
finish (0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (current_value.type () != to_value.type ()) {
|
||||
warning ("to_value of type %s is not of the same type as the property %s which is %s. Can't animate.", to_value.type_name (), property, current_value.type_name ());
|
||||
finish (true);
|
||||
finish (0);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -152,9 +152,9 @@ public class Gala.GesturePropertyTransition : Object {
|
||||
|
||||
unowned var transition = actor.get_transition (property);
|
||||
if (transition == null) {
|
||||
finish (cancel_action);
|
||||
finish (completions);
|
||||
} else {
|
||||
transition.stopped.connect ((is_finished) => finish (cancel_action, is_finished));
|
||||
transition.stopped.connect ((is_finished) => finish (completions, is_finished));
|
||||
}
|
||||
};
|
||||
|
||||
@ -181,9 +181,9 @@ public class Gala.GesturePropertyTransition : Object {
|
||||
}
|
||||
}
|
||||
|
||||
private void finish (bool cancel_action, bool callback = true) {
|
||||
private void finish (int completions, bool callback = true) {
|
||||
if (callback && done_callback != null) {
|
||||
done_callback (cancel_action);
|
||||
done_callback (completions);
|
||||
}
|
||||
|
||||
unref ();
|
||||
|
@ -154,8 +154,8 @@ public class Gala.PanelClone : Object {
|
||||
Utils.x11_unset_window_pass_through (panel.window);
|
||||
}
|
||||
|
||||
new GesturePropertyTransition (clone, gesture_tracker, "y", null, calculate_clone_y (false)).start (with_gesture, (cancel_action) => {
|
||||
if (!cancel_action) {
|
||||
new GesturePropertyTransition (clone, gesture_tracker, "y", null, calculate_clone_y (false)).start (with_gesture, (completions) => {
|
||||
if (completions > 0) {
|
||||
clone.visible = false;
|
||||
panel_hidden = false;
|
||||
}
|
||||
|
@ -678,7 +678,7 @@ namespace Gala {
|
||||
|
||||
// The callback needs to run at the same frame as the others (e.g. PanelClone) so we can't do a simple Timeout here
|
||||
// The actual transition does nothing here, since the opacity just stays at 255
|
||||
new GesturePropertyTransition (this, multitasking_gesture_tracker, "opacity", null, 255u).start (with_gesture, (cancel_action) => {
|
||||
new GesturePropertyTransition (this, multitasking_gesture_tracker, "opacity", null, 255u).start (with_gesture, (completions) => {
|
||||
if (!opening) {
|
||||
foreach (var container in window_containers_monitors) {
|
||||
container.visible = false;
|
||||
@ -695,7 +695,7 @@ namespace Gala {
|
||||
|
||||
animating = false;
|
||||
|
||||
if (cancel_action) {
|
||||
if (completions == 0) {
|
||||
toggle (false, true);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user