js: Ease non-animatable actor properties
Properties that aren't marked as animatable don't support *implicit* animations, but they can still be animated with explicit transitions. Use the newly added convenience method to cut down further on Tweener usage. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/666
This commit is contained in:
@ -11,7 +11,6 @@ const Layout = imports.ui.layout;
|
||||
const Main = imports.ui.main;
|
||||
const PageIndicators = imports.ui.pageIndicators;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
const Tweener = imports.ui.tweener;
|
||||
|
||||
var KEYBOARD_REST_TIME = Layout.KEYBOARD_ANIMATION_TIME * 2;
|
||||
var KEY_LONG_PRESS_TIME = 250;
|
||||
@ -712,15 +711,13 @@ var EmojiPager = GObject.registerClass({
|
||||
let relDelta = Math.abs(this._delta - value) / this._width;
|
||||
let time = PANEL_SWITCH_ANIMATION_TIME * Math.abs(relDelta);
|
||||
|
||||
Tweener.removeTweens(this);
|
||||
Tweener.addTween(this,
|
||||
{ delta: value,
|
||||
time: time / 1000,
|
||||
transition: 'easeInOutQuad',
|
||||
onComplete() {
|
||||
this.setCurrentPage(this.getFollowingPage());
|
||||
}
|
||||
});
|
||||
this.remove_all_transitions();
|
||||
this.ease_property('delta', value, {
|
||||
duration: time,
|
||||
onComplete: () => {
|
||||
this.setCurrentPage(this.getFollowingPage());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -728,12 +725,10 @@ var EmojiPager = GObject.registerClass({
|
||||
let relDelta = Math.abs(this._delta) / this.width;
|
||||
let time = PANEL_SWITCH_ANIMATION_TIME * Math.abs(relDelta);
|
||||
|
||||
Tweener.removeTweens(this);
|
||||
Tweener.addTween(this,
|
||||
{ delta: 0,
|
||||
time: time / 1000,
|
||||
transition: 'easeInOutQuad',
|
||||
});
|
||||
this.remove_all_transitions();
|
||||
this.ease_property('delta', 0, {
|
||||
duration: time,
|
||||
});
|
||||
}
|
||||
|
||||
_initPagingInfo() {
|
||||
|
Reference in New Issue
Block a user