From cde695d903df9d6419cf64b52ae831df412feade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sat, 23 Mar 2013 01:27:22 +0100 Subject: [PATCH] loginDialog: (Optionally) show logo below user list The optional logo on the login screen is currently shown in the top bar, which is not only a rather unprominent position, it also gives the wrong suggestion of a clickable element. Newer designs call for the logo to be shown horizontally centered at the bottom of the screen, so implement that instead. https://bugzilla.gnome.org/show_bug.cgi?id=694912 --- data/theme/gnome-shell.css | 4 ++++ js/gdm/loginDialog.js | 31 ++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index 7cd4c76dc..a46ac407d 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -2393,6 +2393,10 @@ StScrollBar StButton#vhandle:active { height: .75em; } +.login-dialog-logo-bin { + padding: 24px 0px; +} + .login-dialog .modal-dialog-button-box { spacing: 3px; } diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index f9c5894c4..bba17ae68 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -49,7 +49,7 @@ const UserWidget = imports.ui.userWidget; const _FADE_ANIMATION_TIME = 0.25; const _SCROLL_ANIMATION_TIME = 0.5; const _TIMED_LOGIN_IDLE_THRESHOLD = 5.0; -const _LOGO_ICON_HEIGHT = 16; +const _LOGO_ICON_HEIGHT = 48; const WORK_SPINNER_ICON_SIZE = 24; const WORK_SPINNER_ANIMATION_DELAY = 1.0; @@ -553,6 +553,12 @@ const LoginDialog = new Lang.Class({ Lang.bind(this, this._updateBanner)); this._settings.connect('changed::' + GdmUtil.DISABLE_USER_LIST_KEY, Lang.bind(this, this._updateDisableUserList)); + this._settings.connect('changed::' + GdmUtil.LOGO_KEY, + Lang.bind(this, this._updateLogo)); + + this._textureCache = St.TextureCache.get_default(); + this._textureCache.connect('texture-file-changed', + Lang.bind(this, this._updateLogoTexture)); this._userSelectionBox = new St.BoxLayout({ style_class: 'login-dialog-user-selection-box', vertical: true }); @@ -645,6 +651,11 @@ const LoginDialog = new Lang.Class({ x_align: St.Align.START, x_fill: true }); + this._logoBin = new St.Bin({ style_class: 'login-dialog-logo-bin' }); + this._logoBin.set_y_align(Clutter.ActorAlign.END); + this.backgroundStack.add_actor(this._logoBin); + this._updateLogo(); + if (!this._userManager.is_loaded) this._userManagerLoadedId = this._userManager.connect('notify::is-loaded', Lang.bind(this, function() { @@ -691,6 +702,24 @@ const LoginDialog = new Lang.Class({ } }, + _updateLogoTexture: function(cache, uri) { + if (this._logoFileUri != uri) + return; + + let icon = null; + if (this._logoFileUri) + icon = this._textureCache.load_uri_async(this._logoFileUri, + -1, _LOGO_ICON_HEIGHT); + this._logoBin.set_child(icon); + }, + + _updateLogo: function() { + let path = this._settings.get_string(GdmUtil.LOGO_KEY); + + this._logoFileUri = path ? Gio.file_new_for_path(path).get_uri() : null; + this._updateLogoTexture(this._textureCache, this._logoFileUri); + }, + _reset: function() { this._userVerifier.clear();