ScreenShield: when explicitly locking, tween the shield from the top

The curtain should appear to be an overlay on top of the system,
and since it is lifted by dragging up, it makes sense to slide it
down on lock.

https://bugzilla.gnome.org/show_bug.cgi?id=681143
This commit is contained in:
Giovanni Campagna 2012-08-03 19:42:43 +02:00
parent 2f990346df
commit 29958df7e7

View File

@ -17,7 +17,7 @@ const Tweener = imports.ui.tweener;
const SCREENSAVER_SCHEMA = 'org.gnome.desktop.screensaver';
const LOCK_ENABLED_KEY = 'lock-enabled';
const CURTAIN_SLIDE_TIME = 1.2;
const CURTAIN_SLIDE_TIME = 0.8;
// fraction of screen height the arrow must reach before completing
// the slide up automatically
const ARROW_DRAG_TRESHOLD = 0.1;
@ -28,7 +28,7 @@ const SUMMARY_ICON_SIZE = 48;
// STANDARD_FADE_TIME is used when the session goes idle, while
// SHORT_FADE_TIME is used when requesting lock explicitly from the user menu
const STANDARD_FADE_TIME = 10;
const SHORT_FADE_TIME = 2;
const SHORT_FADE_TIME = 0.8;
const Clock = new Lang.Class({
Name: 'ScreenShieldClock',
@ -474,26 +474,27 @@ const ScreenShield = new Lang.Class({
},
_resetLockScreen: function(animate) {
this._lockScreenGroup.show();
this._arrow.show();
if (animate) {
this.actor.opacity = 0;
Tweener.removeTweens(this.actor);
Tweener.addTween(this.actor,
{ opacity: 255,
this._lockScreenGroup.y = -global.screen_height;
Tweener.removeTweens(this._lockScreenGroup);
Tweener.addTween(this._lockScreenGroup,
{ y: 0,
time: SHORT_FADE_TIME,
transition: 'easeOutQuad',
transition: 'linear',
onComplete: function() {
this._lockScreenGroup.fixed_position_set = false;
this.emit('lock-screen-shown');
},
onCompleteScope: this
});
} else {
this._lockScreenGroup.fixed_position_set = false;
this.emit('lock-screen-shown');
}
this._lockScreenGroup.fixed_position_set = false;
this._lockScreenGroup.show();
this._arrow.show();
this._lockScreenGroup.grab_key_focus();
},