[gnome-shell] Fix some fallout from background-size addition



commit 41f69561974c0ed52850d09578f05a3f2e74bd41
Author: Florian MÃllner <fmuellner gnome org>
Date:   Tue Jan 10 01:48:14 2012 +0100

    Fix some fallout from background-size addition
    
    Commit 25948f214e replaced the old hardcoded scaling behavior of
    background-images with the CSS-compliant option to control that
    behavior with the background-size property. Fix some fallout from
    the changed default scaling behavior.

 js/gdm/loginDialog.js     |    3 ++-
 js/ui/endSessionDialog.js |    3 ++-
 js/ui/userMenu.js         |    3 ++-
 3 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index 3700f0c..46f3fa4 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -205,7 +205,8 @@ const UserListItem = new Lang.Class({
             // We use background-image instead of, say, St.TextureCache
             // so the theme writers can add a rounded frame around the image
             // and so theme writers can pick the icon size.
-            this._iconBin.set_style('background-image: url("' + iconFile + '");');
+            this._iconBin.set_style('background-image: url("' + iconFile + '");' +
+                                    'background-size: contain;');
         } else {
             this._iconBin.hide();
         }
diff --git a/js/ui/endSessionDialog.js b/js/ui/endSessionDialog.js
index d21d155..39cbcf8 100644
--- a/js/ui/endSessionDialog.js
+++ b/js/ui/endSessionDialog.js
@@ -333,7 +333,8 @@ const EndSessionDialog = new Lang.Class({
         this._iconBin.child = null;
         if (iconFile) {
             this._iconBin.show();
-            this._iconBin.set_style('background-image: url("' + iconFile + '");');
+            this._iconBin.set_style('background-image: url("' + iconFile + '");' +
+                                    'background-size: contain;');
         } else {
             this._iconBin.hide();
         }
diff --git a/js/ui/userMenu.js b/js/ui/userMenu.js
index fdac848..e1757e3 100644
--- a/js/ui/userMenu.js
+++ b/js/ui/userMenu.js
@@ -239,7 +239,8 @@ const IMStatusChooserItem = new Lang.Class({
     },
 
     _setIconFromFile: function(iconFile) {
-        this._iconBin.set_style('background-image: url("' + iconFile + '");');
+        this._iconBin.set_style('background-image: url("' + iconFile + '");' +
+                                'background-size: contain;');
         this._iconBin.child = null;
     },
 



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