|
2 | 2 | using SysBot.Base; |
3 | 3 | using System; |
4 | 4 | using System.Collections.Generic; |
| 5 | +using System.Drawing; |
5 | 6 | using System.Linq; |
6 | 7 | using System.Threading.Tasks; |
7 | 8 | using System.Windows.Forms; |
@@ -41,7 +42,19 @@ public Main() |
41 | 42 | } |
42 | 43 |
|
43 | 44 | if (Config is not { Width: 0, Height: 0 }) |
44 | | - Size = new(Config.Width, Config.Height); |
| 45 | + { |
| 46 | + Width = Config.Width; |
| 47 | + Height = Config.Height; |
| 48 | + } |
| 49 | + |
| 50 | + B_New.Height = CB_Protocol.Height; |
| 51 | + FLP_BotCreator.Height = B_New.Height + B_New.Margin.Vertical; |
| 52 | + } |
| 53 | + |
| 54 | + protected override void ScaleControl(SizeF factor, BoundsSpecified specified) |
| 55 | + { |
| 56 | + base.ScaleControl(factor, specified); |
| 57 | + TC_Main.ItemSize = new((int)(TC_Main.ItemSize.Width * factor.Width), (int)(TC_Main.ItemSize.Height * factor.Height)); |
45 | 58 | } |
46 | 59 |
|
47 | 60 | private static IPokeBotRunner GetRunner(ProgramConfig cfg) => cfg.Mode switch |
@@ -75,7 +88,6 @@ private async Task BotMonitor() |
75 | 88 |
|
76 | 89 | private void LoadControls() |
77 | 90 | { |
78 | | - MinimumSize = Size; |
79 | 91 | PG_Hub.SelectedObject = RunningEnvironment.Config; |
80 | 92 |
|
81 | 93 | var routines = Enum.GetValues<PokeRoutineType>().Where(z => RunningEnvironment.SupportsRoutine(z)); |
@@ -224,7 +236,7 @@ private bool AddBot(PokeBotState cfg) |
224 | 236 |
|
225 | 237 | private void AddBotControl(PokeBotState cfg) |
226 | 238 | { |
227 | | - var row = new BotController { Width = FLP_Bots.Width }; |
| 239 | + var row = new BotController { Width = FLP_Bots.Width, Anchor = AnchorStyles.Left | AnchorStyles.Right }; |
228 | 240 | row.Initialize(RunningEnvironment, cfg); |
229 | 241 | FLP_Bots.Controls.Add(row); |
230 | 242 | FLP_Bots.SetFlowBreak(row, true); |
|
0 commit comments