From a9f89bfb0528bbad33202d43d7fd017f56203731 Mon Sep 17 00:00:00 2001 From: Paolo Date: Sun, 19 Apr 2026 22:22:00 +0200 Subject: [PATCH 1/4] Added EditorTheme.UserScale support back --- Prowl.Editor/EditorApplication.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Prowl.Editor/EditorApplication.cs b/Prowl.Editor/EditorApplication.cs index 7d015137..9810eb0e 100644 --- a/Prowl.Editor/EditorApplication.cs +++ b/Prowl.Editor/EditorApplication.cs @@ -220,6 +220,22 @@ public void InitializeFont() } } + protected override void PreparePaperFrame() + { + var winSize = Window.InternalWindow.Size; + float cs = Math.Max(0.01f, Window.ContentScale * EditorTheme.UserScale); + PaperInstance.SetResolution(winSize.X / cs, winSize.Y / cs); + PaperInstance.DisplayFramebufferScale = new Float2(cs, cs); + + } + + protected override Float2 GetPaperMousePosition() + { + var p = Input.MousePosition; + float cs = Math.Max(0.01f, Window.ContentScale * EditorTheme.UserScale); + return new Float2(p.X / cs, p.Y / cs); + } + private void ApplyDarkTitleBar() { if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) return; From 4f5289076b5deeac45228934483343d9a4432d42 Mon Sep 17 00:00:00 2001 From: Paolo Date: Sun, 19 Apr 2026 22:25:43 +0200 Subject: [PATCH 2/4] Added Prowl.Vector to EditorApplication --- Prowl.Editor/EditorApplication.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Prowl.Editor/EditorApplication.cs b/Prowl.Editor/EditorApplication.cs index 9810eb0e..339cf842 100644 --- a/Prowl.Editor/EditorApplication.cs +++ b/Prowl.Editor/EditorApplication.cs @@ -9,6 +9,7 @@ using Prowl.Editor.Panels; using Prowl.PaperUI; using Prowl.Runtime; +using Prowl.Vector; namespace Prowl.Editor; From 2a725c8ee61af6dbd80d52b1144629c61bf8c2f8 Mon Sep 17 00:00:00 2001 From: Paolo Date: Sun, 19 Apr 2026 11:43:50 +0200 Subject: [PATCH 3/4] Fixed DPI Scaling issue --- Prowl.Editor/EditorApplication.cs | 2 ++ Prowl.Editor/EditorTheme.cs | 3 +++ Prowl.Editor/Panels/PreferencesPanel.cs | 6 ++++++ Prowl.Editor/Settings/EditorSettings.cs | 2 ++ Prowl.Editor/Settings/EditorThemeData.cs | 2 ++ 5 files changed, 15 insertions(+) diff --git a/Prowl.Editor/EditorApplication.cs b/Prowl.Editor/EditorApplication.cs index 339cf842..0eb29353 100644 --- a/Prowl.Editor/EditorApplication.cs +++ b/Prowl.Editor/EditorApplication.cs @@ -59,6 +59,8 @@ public override void Initialize() System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; InitializeFont(); + Resize(Window.Size.X, Window.Size.Y); + PaperInstance.TextMode = Prowl.Quill.TextRenderMode.Bitmap; // Load Font Awesome as fallback fonts for icons diff --git a/Prowl.Editor/EditorTheme.cs b/Prowl.Editor/EditorTheme.cs index c4959b98..6cb7de20 100644 --- a/Prowl.Editor/EditorTheme.cs +++ b/Prowl.Editor/EditorTheme.cs @@ -12,6 +12,9 @@ public static class EditorTheme public static string DefaultFontName = "segoe ui"; public static string DefaultBoldFontName = "segoe ui"; + // DPI Scaling value + public static float UserScale { get; set; } = 1f; + // Sizing — mutable so themes can override public static float MenuBarHeight = 26f; public static float StatusBarHeight = 22f; diff --git a/Prowl.Editor/Panels/PreferencesPanel.cs b/Prowl.Editor/Panels/PreferencesPanel.cs index 2b9b1349..e5de7b97 100644 --- a/Prowl.Editor/Panels/PreferencesPanel.cs +++ b/Prowl.Editor/Panels/PreferencesPanel.cs @@ -189,6 +189,12 @@ private void DrawTheme(Paper paper, Prowl.Scribe.FontFile font, EditorSettings s PrefTextField(paper, s, "Bold Font", theme.DefaultBoldFontName, v => theme.DefaultBoldFontName = v); }); + // ── Sizing ── + EditorGUI.Foldout(paper, "pref_scl_general", "General Sizing", () => + { + SzSlider(paper, s, "User Scale", theme.UserScale, 0.5f, 2, v => theme.UserScale = v); + }); + // ── Sizing ── EditorGUI.Foldout(paper, "pref_sz_general", "General Sizing", () => { diff --git a/Prowl.Editor/Settings/EditorSettings.cs b/Prowl.Editor/Settings/EditorSettings.cs index 3808712a..68ab64ce 100644 --- a/Prowl.Editor/Settings/EditorSettings.cs +++ b/Prowl.Editor/Settings/EditorSettings.cs @@ -92,6 +92,8 @@ public void ApplyTheme() EditorApplication.Instance?.InitializeFont(); + EditorTheme.UserScale = t.UserScale; + // Sizing EditorTheme.MenuBarHeight = t.MenuBarHeight; EditorTheme.RowHeight = t.RowHeight; diff --git a/Prowl.Editor/Settings/EditorThemeData.cs b/Prowl.Editor/Settings/EditorThemeData.cs index 409665b4..f50dc824 100644 --- a/Prowl.Editor/Settings/EditorThemeData.cs +++ b/Prowl.Editor/Settings/EditorThemeData.cs @@ -95,6 +95,8 @@ public class EditorThemeData public string DefaultBoldFontName { get; set; } = "bahnschrift"; + public float UserScale { get; set; } = 1f; + // Sizing public float MenuBarHeight { get; set; } = 26f; public float RowHeight { get; set; } = 22f; From 94cbe55e0fd32699569715ab74b677a6b6d3b2cb Mon Sep 17 00:00:00 2001 From: Paolo Date: Sun, 19 Apr 2026 22:32:55 +0200 Subject: [PATCH 4/4] Fixed Slider position, added applyOnSlide argument to stop flicker when changing value --- Prowl.Editor/Panels/PreferencesPanel.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Prowl.Editor/Panels/PreferencesPanel.cs b/Prowl.Editor/Panels/PreferencesPanel.cs index e5de7b97..1081d566 100644 --- a/Prowl.Editor/Panels/PreferencesPanel.cs +++ b/Prowl.Editor/Panels/PreferencesPanel.cs @@ -189,15 +189,10 @@ private void DrawTheme(Paper paper, Prowl.Scribe.FontFile font, EditorSettings s PrefTextField(paper, s, "Bold Font", theme.DefaultBoldFontName, v => theme.DefaultBoldFontName = v); }); - // ── Sizing ── - EditorGUI.Foldout(paper, "pref_scl_general", "General Sizing", () => - { - SzSlider(paper, s, "User Scale", theme.UserScale, 0.5f, 2, v => theme.UserScale = v); - }); - // ── Sizing ── EditorGUI.Foldout(paper, "pref_sz_general", "General Sizing", () => { + SzSlider(paper, s, "User Scale", theme.UserScale, 0.5f, 2, v => theme.UserScale = v, false); SzSlider(paper, s, "Font Size", theme.FontSize, 8, 32, v => theme.FontSize = v); SzSlider(paper, s, "Row Height", theme.RowHeight, 16, 40, v => theme.RowHeight = v); SzSlider(paper, s, "Menu Bar Height", theme.MenuBarHeight, 18, 48, v => theme.MenuBarHeight = v); @@ -276,14 +271,17 @@ private void PrefTextField(Paper paper, EditorSettings s, string label, string v } - private void SzSlider(Paper paper, EditorSettings s, string label, float value, float min, float max, Action set) + private void SzSlider(Paper paper, EditorSettings s, string label, float value, float min, float max, Action set, bool applyOnSlide = true) { EditorGUI.Slider(paper, $"pref_sz_{label.Replace(" ", "_")}", label, value, min, max) .OnValueChanged(v => { set(MathF.Round(v, 1)); - s.ApplyTheme(); - s.Save(); + if (applyOnSlide) + { + s.ApplyTheme(); + s.Save(); + } }); }