[gnome-shell/T29763: 191/249] iconGrid: Downscale icon size when comparing to defaults



commit 27f0c9f0c0fc7791240077aed1c686afcb1fd859
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Apr 3 15:28:57 2020 -0300

    iconGrid: Downscale icon size when comparing to defaults
    
    The return value of st_theme_node_lookup_length() is scaled according
    to the scale factor. IconGrid.ICON_SIZE is not. However, when BaseIcon
    tries to fetch the CSS value for "icon-size" (which returns a scaled
    value), it uses it as-is, mixing the two coordinate systems.
    
    Use a single coordinate system (unscaled sizes) in IconGrid.BaseIcon.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1175

 js/ui/iconGrid.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index 0dd9ceb95d..e145f61398 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -136,8 +136,11 @@ class BaseIcon extends St.Bin {
         if (this._setSizeManually) {
             size = this.iconSize;
         } else {
+            const { scaleFactor } =
+                St.ThemeContext.get_for_stage(global.stage);
+
             let [found, len] = node.lookup_length('icon-size', false);
-            size = found ? len : ICON_SIZE;
+            size = found ? len / scaleFactor : ICON_SIZE;
         }
 
         if (this.iconSize == size && this._iconBin.child)


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