Overhaul settings panel layout

- make the panel larger
- place settings widgets in a scroll panel
- arrange settings widgets in two columns
- make tabs in TD vertical
This commit is contained in:
Ivaylo Draganov
2021-09-22 16:59:36 +03:00
committed by reaperrr
parent a36eb585d3
commit 3ecaf76804
24 changed files with 2009 additions and 1565 deletions

View File

@@ -48,5 +48,30 @@ namespace OpenRA.Mods.Common.Widgets.Logic
ss.Value = (float)(int)field.GetValue(group);
ss.OnChange += x => field.SetValue(group, (int)x);
}
public static void AdjustSettingsScrollPanelLayout(ScrollPanelWidget scrollPanel)
{
foreach (var row in scrollPanel.Children)
{
if (row.Children.Count == 0)
continue;
var hasVisibleChildren = false;
foreach (var container in row.Children)
{
if (container.IsVisible())
{
hasVisibleChildren = true;
break;
}
}
if (!hasVisibleChildren)
row.Visible = false;
}
scrollPanel.Layout.AdjustChildren();
}
}
}