[gnome-shell] loginDialog: Indicate whether users are logged in



commit 96c9f8058b658263f02b615a9d225d876ff29f19
Author: Florian MÃllner <fmuellner gnome org>
Date:   Mon Jul 9 20:04:23 2012 +0200

    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 deletions(-)
---
diff --git a/data/Makefile.am b/data/Makefile.am
index 7a80948..09db7c6 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 a0e72f3..6bd6d01 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 0000000..c0267ea
--- /dev/null
+++ b/data/theme/logged-in-indicator.svg
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:xlink="http://www.w3.org/1999/xlink";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="300"
+   height="80"
+   id="svg7355"
+   version="1.1"
+   inkscape:version="0.48.2 r9819"
+   sodipodi:docname="logged-in-indicator.svg">
+  <metadata
+     id="metadata4175">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <sodipodi:namedview
+     pagecolor="#2c1cff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="1"
+     inkscape:pageshadow="2"
+     inkscape:window-width="1440"
+     inkscape:window-height="843"
+     id="namedview4173"
+     showgrid="false"
+     inkscape:zoom="2.8760889"
+     inkscape:cx="106.00403"
+     inkscape:cy="80.68078"
+     inkscape:window-x="0"
+     inkscape:window-y="27"
+     inkscape:window-maximized="1"
+     inkscape:current-layer="g30864" />
+  <defs
+     id="defs7357">
+    <radialGradient
+       xlink:href="#linearGradient36429"
+       id="radialGradient7461"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(2.5919312,0,0,0.57582113,-20.687059,48.400487)"
+       cx="47.428951"
+       cy="167.16817"
+       fx="47.428951"
+       fy="167.16817"
+       r="37" />
+    <linearGradient
+       id="linearGradient36429">
+      <stop
+         id="stop36431"
+         offset="0"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+      <stop
+         id="stop36433"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:0;" />
+    </linearGradient>
+    <radialGradient
+       xlink:href="#linearGradient36471"
+       id="radialGradient7463"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(1.1891549,0,0,0.55513246,-9.281289,36.12653)"
+       cx="49.067139"
+       cy="242.50381"
+       fx="49.067139"
+       fy="242.50381"
+       r="37.00671" />
+    <linearGradient
+       id="linearGradient36471">
+      <stop
+         id="stop36473"
+         offset="0"
+         style="stop-color:#ffffff;stop-opacity:1;" />
+      <stop
+         id="stop36475"
+         offset="1"
+         style="stop-color:#ffffff;stop-opacity:0;" />
+    </linearGradient>
+    <radialGradient
+       r="37.00671"
+       fy="242.50381"
+       fx="49.067139"
+       cy="242.50381"
+       cx="49.067139"
+       gradientTransform="matrix(3.4218418,0,0,0.03365337,-61.309005,138.5071)"
+       gradientUnits="userSpaceOnUse"
+       id="radialGradient7488"
+       xlink:href="#linearGradient36471" />
+  </defs>
+  <g
+     id="layer1"
+     transform="matrix(1.6213276,0,0,1.6213276,-431.6347,-272.5745)">
+    <g
+       style="display:inline"
+       id="g30864"
+       transform="translate(255.223,70.118091)">
+      <rect
+         ry="3.4593496"
+         rx="8.8641119"
+         y="76.159348"
+         x="12.596948"
+         height="71.116341"
+         width="182.22595"
+         id="rect14000"
+         style="opacity:0.371875;fill:url(#radialGradient7461);fill-opacity:1;stroke:none" />
+      <path
+         id="rect34520"
+         d="m 194.80022,146.83551 -182.559919,0"
+         style="opacity:0.35;fill:none;stroke:url(#radialGradient7488);stroke-width:0.61184424;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+         connector-curvature="0"
+         inkscape:connector-curvature="0"
+         sodipodi:nodetypes="cc" />
+    </g>
+  </g>
+</svg>
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 9b84514..39434cf 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');
     },



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]