From 99f6434b50664240f3a8b9c6c916dc8a114a3900 Mon Sep 17 00:00:00 2001 From: JacobTech Date: Mon, 18 Nov 2024 00:46:12 -0500 Subject: [PATCH] Fixed Experiments Size --- Luski/GUI/MainScreen/UI/Generic/LuskiFlow.cs | 22 +++++++++++++++++++ .../SettingsMenuBase/Core/PageFlow.cs | 3 ++- .../UI/SettingsPanel/ExperimentGUI.cs | 6 ++--- Luski/Luski.csproj | 2 +- 4 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 Luski/GUI/MainScreen/UI/Generic/LuskiFlow.cs diff --git a/Luski/GUI/MainScreen/UI/Generic/LuskiFlow.cs b/Luski/GUI/MainScreen/UI/Generic/LuskiFlow.cs new file mode 100644 index 0000000..ea7356c --- /dev/null +++ b/Luski/GUI/MainScreen/UI/Generic/LuskiFlow.cs @@ -0,0 +1,22 @@ +using GraphicsManager.Enums; +using GraphicsManager.Interfaces; +using GraphicsManager.Objects; + +namespace Luski.GUI.MainScreen.UI.Generic; + +public class LuskiFlow : FlowLayout +{ + public override void ParentResize() + { + BlockDraw = true; + for (int i = 0; i < Controls.Length; i++) + { + if (Controls[i] is IParent parent) + { + parent.ParentResize(); + } + } + if (Parent is not null) Parent.TryDraw(); + BlockDraw = false; + } +} \ No newline at end of file diff --git a/Luski/GUI/MainScreen/UI/LuskiControls/SettingsMenuBase/Core/PageFlow.cs b/Luski/GUI/MainScreen/UI/LuskiControls/SettingsMenuBase/Core/PageFlow.cs index e61bc9f..6d4e5ca 100644 --- a/Luski/GUI/MainScreen/UI/LuskiControls/SettingsMenuBase/Core/PageFlow.cs +++ b/Luski/GUI/MainScreen/UI/LuskiControls/SettingsMenuBase/Core/PageFlow.cs @@ -1,10 +1,11 @@ using GraphicsManager.Enums; using GraphicsManager.Objects; using GraphicsManager.Objects.Core; +using Luski.GUI.MainScreen.UI.Generic; namespace Luski.GUI.MainScreen.UI.LuskiControls.SettingsMenuBase.Core; -public class PageFlow : FlowLayout, ISettingsPage +public class PageFlow : LuskiFlow, ISettingsPage { public string PageName { diff --git a/Luski/GUI/MainScreen/UI/SettingsPanel/ExperimentGUI.cs b/Luski/GUI/MainScreen/UI/SettingsPanel/ExperimentGUI.cs index 5a23f5b..0f5ad1e 100644 --- a/Luski/GUI/MainScreen/UI/SettingsPanel/ExperimentGUI.cs +++ b/Luski/GUI/MainScreen/UI/SettingsPanel/ExperimentGUI.cs @@ -38,7 +38,7 @@ public class ExperimentGUI : UserControl } Top = new(Globals.DefaultFont) { - Location = new(5.ScaleInt(), 5.ScaleInt()), + Location = new(5.ScaleInt()), Text = ei.DisplayName }; Label n = new(Globals.MessageFont) @@ -68,7 +68,7 @@ public class ExperimentGUI : UserControl dd = new(Globals.ms.TextureManager.GetTextureResource("RoundedRectangle.png"), new Rectangle() { Size = new(1.ScaleInt()), - BackgroundColor = Color4.Gray, + BackgroundColor = Color4.Gray }, Disabled) { Size = new(base.Size.X, 40.ScaleInt()), @@ -142,7 +142,7 @@ public class ExperimentGUI : UserControl line.ForceDistanceUpdate(this); Controls.Add(line); Controls.Add(Top); - //base.BackgroundColor = new((byte)new Random().Next(255),(byte)new Random().Next(255),(byte)new Random().Next(255),(byte)new Random().Next(255)); + base.BackgroundColor = new((byte)new Random().Next(255),(byte)new Random().Next(255),(byte)new Random().Next(255),(byte)new Random().Next(255)); } private Task DdOnOptionSelected(ExperimentDropButton arg) diff --git a/Luski/Luski.csproj b/Luski/Luski.csproj index 87b6ce2..9ad337a 100644 --- a/Luski/Luski.csproj +++ b/Luski/Luski.csproj @@ -22,7 +22,7 @@ - +