Skip to content

Commit 278b79e

Browse files
committed
Remember program size, split container
1 parent d25bdf2 commit 278b79e

File tree

4 files changed

+86
-48
lines changed

4 files changed

+86
-48
lines changed

SysBot.Pokemon.WinForms/Main.Designer.cs

Lines changed: 76 additions & 48 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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ public Main()
3939
foreach (TabPage tab in TC_Main.TabPages)
4040
tab.UseVisualStyleBackColor = false;
4141
}
42+
43+
if (Config is not { Width: 0, Height: 0 })
44+
Size = new(Config.Width, Config.Height);
4245
}
4346

4447
private static IPokeBotRunner GetRunner(ProgramConfig cfg) => cfg.Mode switch
@@ -121,6 +124,8 @@ async Task WaitUntilNotRunning()
121124
private void SaveCurrentConfig()
122125
{
123126
var cfg = GetCurrentConfiguration();
127+
cfg.Width = Width;
128+
cfg.Height = Height;
124129
ConfigLoader.Save(cfg);
125130
}
126131

SysBot.Pokemon.WinForms/SysBot.Pokemon.WinForms.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<OutputType>WinExe</OutputType>
55
<TargetFramework>net9.0-windows</TargetFramework>
66
<UseWindowsForms>true</UseWindowsForms>
7+
<EnableWindowsTargeting>true</EnableWindowsTargeting>
8+
<ApplicationHighDpiMode>SystemAware</ApplicationHighDpiMode>
9+
<ForceDesignerDpiUnaware>true</ForceDesignerDpiUnaware>
710
</PropertyGroup>
811

912
<PropertyGroup>

SysBot.Pokemon/Structures/ProgramConfig.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ public class ProgramConfig : BotList<PokeBotState>
88
public ProgramMode Mode { get; set; } = ProgramMode.LZA;
99
public PokeTradeHubConfig Hub { get; set; } = new();
1010
public bool DarkMode { get; set; }
11+
public int Width { get; set; }
12+
public int Height { get; set; }
1113
}
1214

1315
public enum ProgramMode

0 commit comments

Comments
 (0)