Skip to content

Commit 466a3e5

Browse files
committed
Another attempt at main window UI design
Not too different, but a more refined mix of what was originally pushed.
1 parent 3a7a191 commit 466a3e5

File tree

2 files changed

+113
-69
lines changed

2 files changed

+113
-69
lines changed

SysBot.Pokemon.WinForms/Main.Designer.cs

Lines changed: 98 additions & 66 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SysBot.Pokemon.WinForms/Main.cs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using SysBot.Base;
33
using System;
44
using System.Collections.Generic;
5+
using System.Drawing;
56
using System.Linq;
67
using System.Threading.Tasks;
78
using System.Windows.Forms;
@@ -41,7 +42,19 @@ public Main()
4142
}
4243

4344
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));
4558
}
4659

4760
private static IPokeBotRunner GetRunner(ProgramConfig cfg) => cfg.Mode switch
@@ -75,7 +88,6 @@ private async Task BotMonitor()
7588

7689
private void LoadControls()
7790
{
78-
MinimumSize = Size;
7991
PG_Hub.SelectedObject = RunningEnvironment.Config;
8092

8193
var routines = Enum.GetValues<PokeRoutineType>().Where(z => RunningEnvironment.SupportsRoutine(z));
@@ -224,7 +236,7 @@ private bool AddBot(PokeBotState cfg)
224236

225237
private void AddBotControl(PokeBotState cfg)
226238
{
227-
var row = new BotController { Width = FLP_Bots.Width };
239+
var row = new BotController { Width = FLP_Bots.Width, Anchor = AnchorStyles.Left | AnchorStyles.Right };
228240
row.Initialize(RunningEnvironment, cfg);
229241
FLP_Bots.Controls.Add(row);
230242
FLP_Bots.SetFlowBreak(row, true);

0 commit comments

Comments
 (0)