Blame SOURCES/0001-prefs-Scale-preview-border.patch

80b029
From ab86a3469bca9246ba5a6039d0cce8c6afae1fc9 Mon Sep 17 00:00:00 2001
80b029
From: =?UTF-8?q?Florian=20M=C3=BCllner?= <fmuellner@gnome.org>
80b029
Date: Tue, 15 Feb 2022 15:25:43 +0100
80b029
Subject: [PATCH] prefs: Scale preview border
80b029
80b029
We currently pick up the settings value directly, which is the
80b029
border that is used on the actual (i.e. monitor-sized) background.
80b029
80b029
That's way too big when applied as-is on the preview, so assume a
80b029
common monitor size and compute an appropriate scale from that.
80b029
---
80b029
 prefs.js | 5 ++++-
80b029
 1 file changed, 4 insertions(+), 1 deletion(-)
80b029
80b029
diff --git a/prefs.js b/prefs.js
80b029
index c8d5903..ba78322 100644
80b029
--- a/prefs.js
80b029
+++ b/prefs.js
80b029
@@ -13,6 +13,7 @@ const ExtensionUtils = imports.misc.extensionUtils;
80b029
 
80b029
 const BACKGROUND_SCHEMA = 'org.gnome.desktop.background';
80b029
 
80b029
+const MONITOR_WIDTH = 1920;
80b029
 const PREVIEW_WIDTH = 400;
80b029
 
80b029
 let BackgroundLogoPrefsWidget = GObject.registerClass(
80b029
@@ -197,7 +198,9 @@ class BackgroundLogoPrefsWidget extends Gtk.Grid {
80b029
     }
80b029
 
80b029
     _getLogoPosition(width, height) {
80b029
-        let scaledBorder = this._settings.get_uint('logo-border');
80b029
+        const previewScale = PREVIEW_WIDTH / MONITOR_WIDTH;
80b029
+        const scaledBorder =
80b029
+            previewScale * this._settings.get_uint('logo-border');
80b029
         let x, y;
80b029
         const position = this._settings.get_string('logo-position');
80b029
         if (position.endsWith('left'))
80b029
-- 
80b029
2.33.1
80b029