mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-23 13:03:15 +00:00
cd57a856fc
PBR shader slghtly improved. Skyobx toggle now works while viewport is active, Cubemaps now have a check wether or not the file given is a valid cube map dds. Update column sizing so forms load much faster Option to right click and clear paths in settings if set
58 lines
1.5 KiB
C#
58 lines
1.5 KiB
C#
using System;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Switch_Toolbox.Library.Forms
|
|
{
|
|
public class STFlowLayoutPanel : FlowLayoutPanel
|
|
{
|
|
public bool FixedWidth { get; set; } = true;
|
|
public bool FixedHeight { get; set; }
|
|
|
|
public STFlowLayoutPanel()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
protected override void OnSizeChanged(EventArgs e)
|
|
{
|
|
if (FixedWidth)
|
|
{
|
|
foreach (Control ctrl in Controls)
|
|
FillWidth(ctrl);
|
|
}
|
|
else if (FixedHeight)
|
|
{
|
|
foreach (Control ctrl in Controls)
|
|
FillHeight(ctrl);
|
|
}
|
|
|
|
base.OnSizeChanged(e);
|
|
}
|
|
|
|
protected override void OnScroll(ScrollEventArgs se)
|
|
{
|
|
this.Invalidate();
|
|
base.OnScroll(se);
|
|
}
|
|
|
|
protected void FillHeight(Control ctrl)
|
|
{
|
|
ctrl.Size = new Size(ClientSize.Height - ctrl.Margin.Bottom - ctrl.Margin.Top, ctrl.Width);
|
|
}
|
|
|
|
protected void FillWidth(Control ctrl)
|
|
{
|
|
ctrl.Size = new Size(ClientSize.Width - ctrl.Margin.Left - ctrl.Margin.Right, ctrl.Height);
|
|
}
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
this.Margin = Padding.Empty;
|
|
this.Padding = Padding.Empty;
|
|
this.DoubleBuffered = true;
|
|
this.SuspendLayout();
|
|
this.ResumeLayout(false);
|
|
}
|
|
}
|
|
}
|