[gnome-shell] Implemented banner support for the login screen
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] Implemented banner support for the login screen
- Date: Fri, 6 Jul 2012 13:00:07 +0000 (UTC)
commit b4464929cbd6c8ceba1c93a5c88f1b6875053450
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Jul 5 21:11:22 2012 -0400
Implemented banner support for the login screen
Based on a patch by Marius Rieder,
https://bugzilla.gnome.org/review?bug=665346
data/theme/gdm.css | 8 ++++++++
js/gdm/loginDialog.js | 31 +++++++++++++++++++++++++++++++
2 files changed, 39 insertions(+), 0 deletions(-)
---
diff --git a/data/theme/gdm.css b/data/theme/gdm.css
index e8e4d2a..daaa575 100644
--- a/data/theme/gdm.css
+++ b/data/theme/gdm.css
@@ -16,6 +16,14 @@
/* Login Dialog */
+.login-dialog-banner {
+ font-size: 10pt;
+ font-weight: bold;
+ text-align: center;
+ color: #666666;
+ padding-bottom: 1em;
+}
+
.login-dialog-title {
font-size: 14pt;
font-weight: bold;
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index c00c214..6ea4151 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -49,6 +49,8 @@ const _LOGO_ICON_NAME_SIZE = 48;
const _LOGIN_SCREEN_SCHEMA = 'org.gnome.login-screen';
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';
@@ -780,11 +782,20 @@ const LoginDialog = new Lang.Class({
this._startFingerprintConversationIfNeeded();
this._settings.connect('changed::' + _LOGO_KEY,
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.contentLayout.add(this._logoBox);
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',
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) {
this._greeterClient.call_start_conversation(_PASSWORD_SERVICE_NAME);
this._startFingerprintConversationIfNeeded();
@@ -1284,6 +1307,14 @@ const LoginDialog = new Lang.Class({
return _fadeOutActor(this._logoBox);
},
+ _fadeInBanner: function() {
+ return _fadeInActor(this._bannerLabel);
+ },
+
+ _fadeOutBanner: function() {
+ return _fadeOutActor(this._bannerLabel);
+ },
+
_fadeInTitleLabel: function() {
return _fadeInActor(this._titleLabel);
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]