From 2b4f4e3723443abaad1dddd504c236caa7d23184 Mon Sep 17 00:00:00 2001 From: Loporrit <141286461+loporrit@users.noreply.github.com> Date: Sat, 10 Feb 2024 14:11:24 +0000 Subject: [PATCH] Shrink settings window even more muahaha --- MareSynchronos/UI/SettingsUi.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/MareSynchronos/UI/SettingsUi.cs b/MareSynchronos/UI/SettingsUi.cs index 017e6b5..35805f9 100644 --- a/MareSynchronos/UI/SettingsUi.cs +++ b/MareSynchronos/UI/SettingsUi.cs @@ -92,8 +92,8 @@ public class SettingsUi : WindowMediatorSubscriberBase SizeConstraints = new WindowSizeConstraints() { - MinimumSize = new Vector2(700, 400), - MaximumSize = new Vector2(700, 2000), + MinimumSize = new Vector2(600, 400), + MaximumSize = new Vector2(600, 2000), }; Mediator.Subscribe(this, (_) => Toggle()); @@ -249,17 +249,21 @@ public class SettingsUi : WindowMediatorSubscriberBase } UiSharedService.DrawHelpText("Shows download text (amount of MiB downloaded) in the transfer bars"); int transferBarWidth = _configService.Current.TransferBarsWidth; - ImGui.SetNextItemWidth(500 * ImGuiHelpers.GlobalScale); - if (ImGui.SliderInt("Transfer Bar Width", ref transferBarWidth, 10, 500)) + ImGui.SetNextItemWidth(250 * ImGuiHelpers.GlobalScale); + if (ImGui.SliderInt("Transfer Bar Width", ref transferBarWidth, 0, 500)) { + if (transferBarWidth < 10) + transferBarWidth = 10; _configService.Current.TransferBarsWidth = transferBarWidth; _configService.Save(); } UiSharedService.DrawHelpText("Width of the displayed transfer bars (will never be less wide than the displayed text)"); int transferBarHeight = _configService.Current.TransferBarsHeight; - ImGui.SetNextItemWidth(500 * ImGuiHelpers.GlobalScale); - if (ImGui.SliderInt("Transfer Bar Height", ref transferBarHeight, 2, 50)) + ImGui.SetNextItemWidth(250 * ImGuiHelpers.GlobalScale); + if (ImGui.SliderInt("Transfer Bar Height", ref transferBarHeight, 0, 50)) { + if (transferBarHeight < 2) + transferBarHeight = 2; _configService.Current.TransferBarsHeight = transferBarHeight; _configService.Save(); }