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