Implemented banner support for the login screen

Based on a patch by Marius Rieder,
https://bugzilla.gnome.org/review?bug=665346
This commit is contained in:
Matthias Clasen 2012-07-05 21:11:22 -04:00
parent 3ea22f8b0e
commit b4464929cb
2 changed files with 39 additions and 0 deletions

View File

@ -16,6 +16,14 @@
/* Login Dialog */ /* Login Dialog */
.login-dialog-banner {
font-size: 10pt;
font-weight: bold;
text-align: center;
color: #666666;
padding-bottom: 1em;
}
.login-dialog-title { .login-dialog-title {
font-size: 14pt; font-size: 14pt;
font-weight: bold; font-weight: bold;

View File

@ -49,6 +49,8 @@ const _LOGO_ICON_NAME_SIZE = 48;
const _LOGIN_SCREEN_SCHEMA = 'org.gnome.login-screen'; const _LOGIN_SCREEN_SCHEMA = 'org.gnome.login-screen';
const _FINGERPRINT_AUTHENTICATION_KEY = 'enable-fingerprint-authentication'; const _FINGERPRINT_AUTHENTICATION_KEY = 'enable-fingerprint-authentication';
const _BANNER_MESSAGE_KEY = 'banner-message-enable';
const _BANNER_MESSAGE_TEXT_KEY = 'banner-message-text';
const _LOGO_KEY = 'logo'; const _LOGO_KEY = 'logo';
@ -780,11 +782,20 @@ const LoginDialog = new Lang.Class({
this._startFingerprintConversationIfNeeded(); this._startFingerprintConversationIfNeeded();
this._settings.connect('changed::' + _LOGO_KEY, this._settings.connect('changed::' + _LOGO_KEY,
Lang.bind(this, this._updateLogo)); Lang.bind(this, this._updateLogo));
this._settings.connect('changed::' + _BANNER_MESSAGE_KEY,
Lang.bind(this, this._updateBanner));
this._settings.connect('changed::' + _BANNER_MESSAGE_TEXT_KEY,
Lang.bind(this, this._updateBanner));
this._logoBox = new St.Bin({ style_class: 'login-dialog-logo-box' }); this._logoBox = new St.Bin({ style_class: 'login-dialog-logo-box' });
this.contentLayout.add(this._logoBox); this.contentLayout.add(this._logoBox);
this._updateLogo(); this._updateLogo();
this._bannerLabel = new St.Label({ style_class: 'login-dialog-banner',
text: '' });
this.contentLayout.add(this._bannerLabel);
this._updateBanner();
this._titleLabel = new St.Label({ style_class: 'login-dialog-title', this._titleLabel = new St.Label({ style_class: 'login-dialog-title',
text: C_("title", "Sign In") }); text: C_("title", "Sign In") });
@ -917,6 +928,18 @@ const LoginDialog = new Lang.Class({
}, },
_updateBanner: function() {
let enabled = this._settings.get_boolean(_BANNER_MESSAGE_KEY);
let text = this._settings.get_string(_BANNER_MESSAGE_TEXT_KEY);
if (enabled && text) {
this._bannerLabel.set_text(text);
this._fadeInBanner();
} else {
this._fadeOutBanner();
}
},
_onReset: function(client, serviceName) { _onReset: function(client, serviceName) {
this._greeterClient.call_start_conversation(_PASSWORD_SERVICE_NAME); this._greeterClient.call_start_conversation(_PASSWORD_SERVICE_NAME);
this._startFingerprintConversationIfNeeded(); this._startFingerprintConversationIfNeeded();
@ -1284,6 +1307,14 @@ const LoginDialog = new Lang.Class({
return _fadeOutActor(this._logoBox); return _fadeOutActor(this._logoBox);
}, },
_fadeInBanner: function() {
return _fadeInActor(this._bannerLabel);
},
_fadeOutBanner: function() {
return _fadeOutActor(this._bannerLabel);
},
_fadeInTitleLabel: function() { _fadeInTitleLabel: function() {
return _fadeInActor(this._titleLabel); return _fadeInActor(this._titleLabel);
}, },