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:
committed by
reaperrr
parent
a36eb585d3
commit
3ecaf76804
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user