From d6fea09aad6b4972a3e00616598459ed91fb697d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jaakko=20Kera=CC=88nen?= jaakko.keranen@iki.fi
Date: Thu, 12 Jan 2023 10:28:07 +0200
Subject: [PATCH 1/1] Apply UI scaling factor changes to all windows
In addition to updating the scaling factor of existing windows,
always ensure that new windows use the correct scaling factor, too.
src/app.c | 9 +++++++--
src/ui/window.c | 4 +---
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/app.c b/src/app.c
index 5563593a..3c6014fa 100644
--- a/src/app.c
+++ b/src/app.c
@@ -2655,8 +2655,13 @@ static void updateImageStyleButton_(iLabelWidget *button, int style) {
static iBool handlePrefsCommands_(iWidget *d, const char *cmd) {
if (equal_Command(cmd, "prefs.dismiss") || equal_Command(cmd, "preferences")) {
setupSheetTransition_Mobile(d, iFalse);
setUiScale_Window(get_Window(),
toFloat_String(text_InputWidget(findChild_Widget(d, "prefs.uiscale"))));
/* Apply the new UI scaling factor to all non-popup windows. */ {
const float uiScale =
toFloat_String(text_InputWidget(findChild_Widget(d, "prefs.uiscale")));
iConstForEach(PtrArray, i, regularWindows_App()) {
setUiScale_Window(i.ptr, uiScale);
}
}
#if defined (LAGRANGE_ENABLE_DOWNLOAD_EDIT)
postCommandf_App("downloads path:%s",
cstr_String(text_InputWidget(findChild_Widget(d, "prefs.downloads"))));
diff --git a/src/ui/window.c b/src/ui/window.c
index 2d20c0e3..774cfba3 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -1691,9 +1691,7 @@ void setUiScale_Window(iWindow *d, float uiScale) {
notifyMetricsChange_Window_(d);
}
}
initialUiScale_ = uiScale;
}
void setFreezeDraw_MainWindow(iMainWindow *d, iBool freezeDraw) {
--
2.25.1
text/plain
This content has been proxied by September (3851b).