From 1ef081884a556f5628dcd2e526f04343a4b7ce26 Mon Sep 17 00:00:00 2001 From: ike709 Date: Fri, 18 Oct 2024 12:20:27 -0500 Subject: [PATCH 1/4] Apply UIScale to ControlWindow size --- OpenDreamClient/Interface/Controls/ControlWindow.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/OpenDreamClient/Interface/Controls/ControlWindow.cs b/OpenDreamClient/Interface/Controls/ControlWindow.cs index 77989e0e00..0d72be6dde 100644 --- a/OpenDreamClient/Interface/Controls/ControlWindow.cs +++ b/OpenDreamClient/Interface/Controls/ControlWindow.cs @@ -4,12 +4,15 @@ using Robust.Client.Graphics; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; +using Robust.Shared; +using Robust.Shared.Configuration; namespace OpenDreamClient.Interface.Controls; public sealed class ControlWindow : InterfaceControl { [Dependency] private readonly IClyde _clyde = default!; [Dependency] private readonly IUserInterfaceManager _uiMgr = default!; + [Dependency] private readonly IConfigurationManager _configurationManager = default!; private readonly ISawmill _sawmill = Logger.GetSawmill("opendream.window"); @@ -336,7 +339,11 @@ public override void SetProperty(string property, string value, bool manualWinse switch (property) { case "size": if (_myWindow.osWindow is {ClydeWindow: not null}) { - _myWindow.osWindow.ClydeWindow.Size = new DMFPropertySize(value).Vector; + var size = new DMFPropertySize(value); + var uiScale = _configurationManager.GetCVar(CVars.DisplayUIScale); + size.X = (int)(size.X * uiScale); + size.Y = (int)(size.Y * uiScale); + _myWindow.osWindow.ClydeWindow.Size = size.Vector; } return; From bae67f82198354cee3fbb7cd1cddaac3eea7586d Mon Sep 17 00:00:00 2001 From: ike709 Date: Sat, 19 Oct 2024 19:01:45 -0500 Subject: [PATCH 2/4] Update OpenDreamClient/Interface/Controls/ControlWindow.cs Co-authored-by: wixoa --- OpenDreamClient/Interface/Controls/ControlWindow.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenDreamClient/Interface/Controls/ControlWindow.cs b/OpenDreamClient/Interface/Controls/ControlWindow.cs index 0d72be6dde..de4bb4b7f5 100644 --- a/OpenDreamClient/Interface/Controls/ControlWindow.cs +++ b/OpenDreamClient/Interface/Controls/ControlWindow.cs @@ -341,7 +341,7 @@ public override void SetProperty(string property, string value, bool manualWinse if (_myWindow.osWindow is {ClydeWindow: not null}) { var size = new DMFPropertySize(value); var uiScale = _configurationManager.GetCVar(CVars.DisplayUIScale); - size.X = (int)(size.X * uiScale); + size.X = (int)(size.X * uiScale); // TODO: RT should probably do this itself size.Y = (int)(size.Y * uiScale); _myWindow.osWindow.ClydeWindow.Size = size.Vector; } From 61891f6e19e7d1f928abbfcb75dd626616ee4515 Mon Sep 17 00:00:00 2001 From: ike709 Date: Sat, 19 Oct 2024 19:01:59 -0500 Subject: [PATCH 3/4] Update OpenDreamClient/Interface/Controls/ControlWindow.cs Co-authored-by: wixoa --- OpenDreamClient/Interface/Controls/ControlWindow.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenDreamClient/Interface/Controls/ControlWindow.cs b/OpenDreamClient/Interface/Controls/ControlWindow.cs index de4bb4b7f5..b2a2cb93ca 100644 --- a/OpenDreamClient/Interface/Controls/ControlWindow.cs +++ b/OpenDreamClient/Interface/Controls/ControlWindow.cs @@ -340,7 +340,7 @@ public override void SetProperty(string property, string value, bool manualWinse case "size": if (_myWindow.osWindow is {ClydeWindow: not null}) { var size = new DMFPropertySize(value); - var uiScale = _configurationManager.GetCVar(CVars.DisplayUIScale); + var uiScale = _myWindow.osWindow.UIScale; size.X = (int)(size.X * uiScale); // TODO: RT should probably do this itself size.Y = (int)(size.Y * uiScale); _myWindow.osWindow.ClydeWindow.Size = size.Vector; From a2408b1292fa190a1bdc37b9237b2225161cbfc2 Mon Sep 17 00:00:00 2001 From: ike709 Date: Sat, 19 Oct 2024 19:02:31 -0500 Subject: [PATCH 4/4] Update OpenDreamClient/Interface/Controls/ControlWindow.cs --- OpenDreamClient/Interface/Controls/ControlWindow.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/OpenDreamClient/Interface/Controls/ControlWindow.cs b/OpenDreamClient/Interface/Controls/ControlWindow.cs index b2a2cb93ca..a0780bdb9a 100644 --- a/OpenDreamClient/Interface/Controls/ControlWindow.cs +++ b/OpenDreamClient/Interface/Controls/ControlWindow.cs @@ -4,15 +4,12 @@ using Robust.Client.Graphics; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; -using Robust.Shared; -using Robust.Shared.Configuration; namespace OpenDreamClient.Interface.Controls; public sealed class ControlWindow : InterfaceControl { [Dependency] private readonly IClyde _clyde = default!; [Dependency] private readonly IUserInterfaceManager _uiMgr = default!; - [Dependency] private readonly IConfigurationManager _configurationManager = default!; private readonly ISawmill _sawmill = Logger.GetSawmill("opendream.window");