[gnome-shell/wip/fmuellner/symbolic-user-icon: 32/32] system: Always use default avatar in switch-user submenu



commit a29370e29ab6f2703f917cbace17b9a7fb89887b
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Feb 5 13:55:14 2019 +0100

    system: Always use default avatar in switch-user submenu
    
    It is too small to be really useful, and sticks out being the
    only color icon.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/issues/957

 data/theme/gnome-shell-sass/_common.scss |  6 +-----
 js/ui/status/system.js                   | 24 ++++--------------------
 2 files changed, 5 insertions(+), 25 deletions(-)
---
diff --git a/data/theme/gnome-shell-sass/_common.scss b/data/theme/gnome-shell-sass/_common.scss
index 3eb95331d..44bf04ec3 100644
--- a/data/theme/gnome-shell-sass/_common.scss
+++ b/data/theme/gnome-shell-sass/_common.scss
@@ -1080,11 +1080,7 @@ StScrollBar {
 
   // a little unstructured mess:
 
-  .system-switch-user-submenu-icon.user-icon {
-    icon-size: 20px;
-    padding: 0 2px;
-  }
-  .system-switch-user-submenu-icon.default-icon {
+  .system-switch-user-submenu-icon {
     icon-size: 16px;
     padding: 0 4px;
   }
diff --git a/js/ui/status/system.js b/js/ui/status/system.js
index bbbc44ea1..7e6905c7c 100644
--- a/js/ui/status/system.js
+++ b/js/ui/status/system.js
@@ -2,7 +2,6 @@
 
 const AccountsService = imports.gi.AccountsService;
 const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
 const GLib = imports.gi.GLib;
 const Shell = imports.gi.Shell;
 const St = imports.gi.St;
@@ -175,24 +174,6 @@ var Indicator = class extends PanelMenu.SystemIndicator {
         let layout = clutterText.get_layout();
         if (layout.is_ellipsized())
             this._switchUserSubMenu.label.text = this._user.get_user_name();
-
-        let iconFile = this._user.get_icon_file();
-        if (iconFile && !GLib.file_test(iconFile, GLib.FileTest.EXISTS))
-            iconFile = null;
-
-        if (iconFile) {
-            let file = Gio.File.new_for_path(iconFile);
-            let gicon = new Gio.FileIcon({ file: file });
-            this._switchUserSubMenu.icon.gicon = gicon;
-
-            this._switchUserSubMenu.icon.add_style_class_name('user-icon');
-            this._switchUserSubMenu.icon.remove_style_class_name('default-icon');
-        } else {
-            this._switchUserSubMenu.icon.icon_name = 'avatar-default-symbolic';
-
-            this._switchUserSubMenu.icon.add_style_class_name('default-icon');
-            this._switchUserSubMenu.icon.remove_style_class_name('user-icon');
-        }
     }
 
     _createActionButton(iconName, accessibleName) {
@@ -210,7 +191,10 @@ var Indicator = class extends PanelMenu.SystemIndicator {
         let item;
 
         this._switchUserSubMenu = new PopupMenu.PopupSubMenuMenuItem('', true);
-        this._switchUserSubMenu.icon.style_class = 'system-switch-user-submenu-icon';
+        this._switchUserSubMenu.icon.set({
+            icon_name: 'avatar-default-symbolic',
+            style_class: 'system-switch-user-submenu-icon'
+        });
 
         // Since the label of the switch user submenu depends on the width of
         // the popup menu, and we can't easily connect on allocation-changed


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