From f81ab36914f26c797238ab30fede5d13855cfdd2 Mon Sep 17 00:00:00 2001 From: Peter Bui Date: Fri, 14 Jan 2022 17:05:33 -0500 Subject: [PATCH] fix: factor in monitor scaling for application library (#277) This addresses the problem where the application library is too large when a scaling factor is applied. To fix this, we get the scale factor and apply to the height and width: monitorScale = 1/St.ThemeContext.get_for_stage(global.stage).scale_factor; height = Math.floor(monitorScale*monitor.height*.5 / 168) * 168 width = Math.ceil(monitorScale*monitor.width*.6 / 168) * 168 Fixes #290. --- applications.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/applications.js b/applications.js index 0aee33c..3a1b013 100644 --- a/applications.js +++ b/applications.js @@ -1148,10 +1148,11 @@ var CosmicAppsDialog = GObject.registerClass({ // Resize Scroll View in App Display based on monitor dimensions const monitor = this.monitor(); - const height = Math.floor(monitor.height*.5 / 168) * 168; - const width = Math.ceil(monitor.width*.6 / 168) * 168; - this.appDisplay.resize(height, width); + const monitorScale = 1/St.ThemeContext.get_for_stage(global.stage).scale_factor; + const height = Math.floor(monitorScale*monitor.height*.5 / 168) * 168; + const width = Math.ceil(monitorScale*monitor.width*.6 / 168) * 168; + this.appDisplay.resize(height, width); this.appDisplay.reset(); // Update 'checked' state of Applications button