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
This commit is contained in:
Florian Müllner
2012-07-09 20:04:23 +02:00
parent a3f4bca14e
commit 96c9f8058b
4 changed files with 149 additions and 1 deletions

View File

@ -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');
},