Skip to content

Commit

Permalink
Fixed aiPanel not resizing
Browse files Browse the repository at this point in the history
  • Loading branch information
n00mkrad committed Sep 7, 2021
1 parent 1cf361e commit 10b3f45
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 9 additions & 5 deletions Code/Main/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -825,20 +825,24 @@ private void MainForm_Resize(object sender, EventArgs e)
bool leftScrollbar = flowPanelLeft.VerticalScroll.Visible;
bool rightScrollbar = flowPanelRight.VerticalScroll.Visible;

Panel[] lPanels = new Panel[] { mdlPanel, esrganPanel, compPanel, prevInfoPanel, prevCtrlPanel, leftSpacer1, leftSpacer2, leftSpacer3, leftSpacer4, };
Panel[] lPanels = new Panel[] { aiPanel, mdlPanel, esrganPanel, compPanel, prevInfoPanel, prevCtrlPanel, leftSpacer1, leftSpacer2, leftSpacer3, leftSpacer4, };
Panel[] rPanels = new Panel[] { imgOptsPanel, preResizePanel, postResizePanel, savePanel, upscalePanel, rSpacer1, rSpacer2, rSpacer3, rSpacer4, };

if (leftScrollbar && !lastLeftScrollbarState)
{ foreach(Panel p in lPanels) p.Width -= scrollbarOffset; }
foreach(Panel p in lPanels)
p.Width -= scrollbarOffset;

if (!leftScrollbar && lastLeftScrollbarState)
{ foreach (Panel p in lPanels) p.Width += scrollbarOffset; }
foreach (Panel p in lPanels)
p.Width += scrollbarOffset;

if (rightScrollbar && !lastRightScrollbarState)
{ foreach (Panel p in rPanels) p.Width -= scrollbarOffset; }
foreach (Panel p in rPanels)
p.Width -= scrollbarOffset;

if (!rightScrollbar && lastRightScrollbarState)
{ foreach (Panel p in rPanels) p.Width += scrollbarOffset; }
foreach (Panel p in rPanels)
p.Width += scrollbarOffset;

lastLeftScrollbarState = leftScrollbar;
lastRightScrollbarState = rightScrollbar;
Expand Down
2 changes: 1 addition & 1 deletion Code/Main/Servers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static async Task Init(ComboBox comboBox = null)
Logger.Log($"[Servers] Closest Server: {closest.Key[0]} ({closest.Value} ms)", true);
closestServer = new Server { name = closest.Key[0], host = closest.Key[1], pattern = closest.Key[2] };

if(comboBox != null)
if (comboBox != null)
{
for (int i = 0; i < comboBox.Items.Count; i++)
{
Expand Down

0 comments on commit 10b3f45

Please sign in to comment.