[gnome-shell] loginDialog: Add an :expanded pseudo class to the user list
- From: Florian MÃllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] loginDialog: Add an :expanded pseudo class to the user list
- Date: Wed, 1 Aug 2012 20:27:50 +0000 (UTC)
commit a3f4bca14eb1c8f477a34d1101ac46395430d59b
Author: Florian MÃllner <fmuellner gnome org>
Date: Wed Aug 1 17:14:00 2012 +0200
loginDialog: Add an :expanded pseudo class to the user list
We want to style user list items differently depending on whether
the list is expanded or shrunk; instead of manually updating the
items' style, we can just expose the :expanded style on the list
itself and use that in the CSS.
https://bugzilla.gnome.org/show_bug.cgi?id=658185
data/theme/gnome-shell.css | 4 ++--
js/gdm/loginDialog.js | 7 +++++--
2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css
index 507e349..a0e72f3 100644
--- a/data/theme/gnome-shell.css
+++ b/data/theme/gnome-shell.css
@@ -2070,7 +2070,7 @@ StButton.popup-menu-item:insensitive {
}
.login-dialog-user-list-item:hover .login-dialog-user-list-item-name,
-.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 {
color: white;
text-shadow: black 0px 2px 2px;
}
@@ -2079,7 +2079,7 @@ StButton.popup-menu-item:insensitive {
background-color: rgba(255,255,255,0.1);
}
-.login-dialog-user-list-item:focus {
+.login-dialog-user-list:expanded .login-dialog-user-list-item:focus {
background-color: rgba(255,255,255,0.33);
}
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 54cf814..9b84514 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -173,7 +173,7 @@ const UserListItem = new Lang.Class({
},
syncStyleClasses: function() {
- if (this.actor.can_focus && global.stage.get_key_focus() == this.actor)
+ if (global.stage.get_key_focus() == this.actor)
this.actor.add_style_pseudo_class('focus');
else
this.actor.remove_style_pseudo_class('focus');
@@ -223,7 +223,8 @@ const UserList = new Lang.Class({
Gtk.PolicyType.AUTOMATIC);
this._box = new St.BoxLayout({ vertical: true,
- style_class: 'login-dialog-user-list' });
+ style_class: 'login-dialog-user-list',
+ pseudo_class: 'expanded' });
this.actor.add_actor(this._box);
this._items = {};
@@ -313,6 +314,7 @@ const UserList = new Lang.Class({
});
}
+ this._box.remove_style_pseudo_class('expanded');
let batch = new Batch.ConsecutiveBatch(this,
[function() {
return GdmUtil.fadeOutActor(this.actor.vscroll);
@@ -368,6 +370,7 @@ const UserList = new Lang.Class({
});
}
+ this._box.add_style_pseudo_class('expanded');
let batch = new Batch.ConsecutiveBatch(this,
[function() {
this.takeOverWhitespace();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]