From b0060fb4d036d61ad800841c714ebb54aaaa0bb8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20K=C3=BCrten?= <sebastian@mobanisto.de>
Date: Sat, 18 Feb 2023 12:38:13 +0100
Subject: [PATCH] Document executable for setting custom UI scale for previews

---
 HACKING.md                                                | 8 ++++++++
 .../kotlin/org/briarproject/briar/desktop/ui/BriarUi.kt   | 3 ++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/HACKING.md b/HACKING.md
index 7766dbf629..087cbddc4d 100644
--- a/HACKING.md
+++ b/HACKING.md
@@ -93,3 +93,11 @@ those preferences is not as straightforward. There is however a
 platform-independent UI tool called [JPUI](http://jpui.sourceforge.net/) that
 allows you to inspect and edit them easily. Last release is from 2004, but it
 still works ;)
+
+There's a setting for UI previews in a separate settings node
+(`~/.java/.userPrefs/org/briarproject/briar/desktop/utils/prefs.xml` on Linux).
+In order to scale UI previews up on high-density devices, run
+`org.briarproject.briar.desktop.SetPreviewUtilsDensity` from the test sources
+once with a custom UI scale value that works on your machine.
+That will persist the UI scale in the settings node so that all previews are
+scaled using that factor from then on.
diff --git a/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/ui/BriarUi.kt b/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/ui/BriarUi.kt
index 897ee60ff4..90fa3b407e 100644
--- a/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/ui/BriarUi.kt
+++ b/briar-desktop/src/main/kotlin/org/briarproject/briar/desktop/ui/BriarUi.kt
@@ -222,7 +222,8 @@ constructor(
                 LocalConfiguration provides configuration,
                 LocalTextContextMenu provides BriarTextContextMenu,
             ) {
-                // invalidate whole application window in case the theme or language setting is changed
+                // invalidate whole application window in case the theme, language or UI scale
+                // setting is changed
                 configuration.invalidateScreen.react {
                     return@CompositionLocalProvider
                 }
-- 
GitLab