[gnome-shell-extensions/wip/fmuellner/apps-menu-scale] appsMenu: Consider scale-factor in height computation



commit c0454db0c6c027f6b58b69a82965d2be1fea2986
Author: Florian Müllner <fmuellner gnome org>
Date:   Sun Sep 23 16:34:06 2018 +0200

    appsMenu: Consider scale-factor in height computation
    
    Actor heights are in physical pixels, while CSS measures are in logical
    pixels, so we need to adjust accordingly to prevent the scale factor
    from being applied twice.
    
    https://gitlab.gnome.org/GNOME/gnome-shell-extensions/issues/102

 extensions/apps-menu/extension.js | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
index deb6cc3..a4aa852 100644
--- a/extensions/apps-menu/extension.js
+++ b/extensions/apps-menu/extension.js
@@ -685,7 +685,10 @@ class ApplicationsButton extends PanelMenu.Button {
         //Load applications
         this._displayButtons(this._listApplications(null));
 
-        let height = this.categoriesBox.height + MENU_HEIGHT_OFFSET + 'px';
+        let themeContext = St.ThemeContext.get_for_stage(global.stage);
+        let scaleFactor = themeContext.scale_factor;
+        let categoriesHeight = this.categoriesBox.height / scaleFactor;
+        let height = Math.round(categoriesHeight) + MENU_HEIGHT_OFFSET + 'px';
         this.mainBox.style+=('height: ' + height);
     }
 


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