From 96c9f8058b658263f02b615a9d225d876ff29f19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Mon, 9 Jul 2012 20:04:23 +0200 Subject: [PATCH] loginDialog: Indicate whether users are logged in Unlike the fallback gdm UI, we do not indicate in the user list whether a user already has an open session or not. This information is useful, so use a spotlight effect similar to the running-app indicator to mark logged in users. https://bugzilla.gnome.org/show_bug.cgi?id=658185 --- data/Makefile.am | 1 + data/theme/gnome-shell.css | 8 +- data/theme/logged-in-indicator.svg | 130 +++++++++++++++++++++++++++++ js/gdm/loginDialog.js | 11 +++ 4 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 data/theme/logged-in-indicator.svg diff --git a/data/Makefile.am b/data/Makefile.am index 7a80948b6..09db7c6c1 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -35,6 +35,7 @@ dist_theme_DATA = \ theme/filter-selected-ltr.svg \ theme/filter-selected-rtl.svg \ theme/gnome-shell.css \ + theme/logged-in-indicator.svg \ theme/panel-button-border.svg \ theme/panel-button-highlight-narrow.svg \ theme/panel-button-highlight-wide.svg \ diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index a0e72f37c..6bd6d015e 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -2070,7 +2070,8 @@ StButton.popup-menu-item:insensitive { } .login-dialog-user-list-item:hover .login-dialog-user-list-item-name, -.login-dialog-user-list:expanded .login-dialog-user-list-item:focus .login-dialog-user-list-item-name { +.login-dialog-user-list:expanded .login-dialog-user-list-item:focus .login-dialog-user-list-item-name, +.login-dialog-user-list:expanded .login-dialog-user-list-item:logged-in { color: white; text-shadow: black 0px 2px 2px; } @@ -2083,6 +2084,11 @@ StButton.popup-menu-item:insensitive { background-color: rgba(255,255,255,0.33); } +.login-dialog-user-list:expanded .login-dialog-user-list-item:logged-in { + background-image: url("logged-in-indicator.svg"); + background-size: contain; +} + .login-dialog-user-list-item-text-box { padding: 0 0.5em; } diff --git a/data/theme/logged-in-indicator.svg b/data/theme/logged-in-indicator.svg new file mode 100644 index 000000000..c0267ea01 --- /dev/null +++ b/data/theme/logged-in-indicator.svg @@ -0,0 +1,130 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js index 9b8451451..39434cf94 100644 --- a/js/gdm/loginDialog.js +++ b/js/gdm/loginDialog.js @@ -118,6 +118,7 @@ const UserListItem = new Lang.Class({ y_align: St.Align.END }); this._updateIcon(); + this._updateLoggedIn(); this.actor.connect('clicked', Lang.bind(this, this._onClicked)); }, @@ -125,6 +126,7 @@ const UserListItem = new Lang.Class({ _onUserChanged: function() { this._nameLabel.set_text(this.user.get_real_name()); this._updateIcon(); + this._updateLoggedIn(); }, _setIconFromFile: function(iconFile, styleClass) { @@ -173,12 +175,21 @@ const UserListItem = new Lang.Class({ }, syncStyleClasses: function() { + this._updateLoggedIn(); + if (global.stage.get_key_focus() == this.actor) this.actor.add_style_pseudo_class('focus'); else this.actor.remove_style_pseudo_class('focus'); }, + _updateLoggedIn: function() { + if (this.user.is_logged_in()) + this.actor.add_style_pseudo_class('logged-in'); + else + this.actor.remove_style_pseudo_class('logged-in'); + }, + _onClicked: function() { this.emit('activate'); },