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



commit 752e454fbe2a18017246afd649e31d22705ae91d
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                   | 25 +++++--------------------
 2 files changed, 6 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 e06f17920..701d9db33 100644
--- a/js/ui/status/system.js
+++ b/js/ui/status/system.js
@@ -1,6 +1,6 @@
 // -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
 
-const { AccountsService, Clutter, Gio, GLib, GObject, Shell, St } = imports.gi;
+const { AccountsService, Clutter, GLib, GObject, Shell, St } = imports.gi;
 
 const BoxPointer = imports.ui.boxpointer;
 const SystemActions = imports.misc.systemActions;
@@ -169,24 +169,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) {
@@ -204,7 +186,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]