mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-12-24 17:29:23 +01:00
Made the Element.Children collection public
This commit is contained in:
parent
fb3b586a35
commit
3a055129b5
5 changed files with 7 additions and 6 deletions
|
@ -33,6 +33,7 @@ Improvements
|
|||
- **Include the SpriteBatchContext in OnDrawn, OnElementDrawn and OnSelectedElementDrawn**
|
||||
- Allow scrolling panels to set height based on children by setting TreatSizeAsMaximum
|
||||
- Track element area update recursion count in UiMetrics
|
||||
- Made the Element.Children collection public
|
||||
|
||||
Fixes
|
||||
- Fixed hidden scroll bars inhibiting scrolling on their parent panel
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace Demos {
|
|||
this.activeDemo = null;
|
||||
selection.IsHidden = false;
|
||||
e.IsHidden = true;
|
||||
selection.Root.SelectElement(selection.GetChildren().First(c => c.CanBeSelected));
|
||||
selection.Root.SelectElement(selection.Children.First(c => c.CanBeSelected));
|
||||
},
|
||||
IsHidden = true
|
||||
});
|
||||
|
|
|
@ -254,9 +254,9 @@ namespace Demos {
|
|||
this.root.AddChild(new VerticalSpace(3));
|
||||
this.root.AddChild(new Paragraph(Anchor.AutoLeft, 1, "The code for this demo contains some examples for how to query element data. This is the output of that:"));
|
||||
|
||||
var children = this.root.GetChildren();
|
||||
var children = this.root.Children;
|
||||
var totalChildren = this.root.GetChildren(regardGrandchildren: true);
|
||||
this.root.AddChild(new Paragraph(Anchor.AutoLeft, 1, $"The root has <b>{children.Count()}</b> children, but there are <b>{totalChildren.Count()}</b> when regarding children's children"));
|
||||
this.root.AddChild(new Paragraph(Anchor.AutoLeft, 1, $"The root has <b>{children.Count}</b> children, but there are <b>{totalChildren.Count()}</b> when regarding children's children"));
|
||||
|
||||
var textFields = this.root.GetChildren<TextField>();
|
||||
this.root.AddChild(new Paragraph(Anchor.AutoLeft, 1, $"The root has <b>{textFields.Count()}</b> text fields"));
|
||||
|
@ -270,7 +270,7 @@ namespace Demos {
|
|||
this.root.AddChild(new Paragraph(Anchor.AutoLeft, 1, $"The root has <b>{autoWidthChildren.Count()}</b> auto-width children, <b>{autoWidthButtons.Count()}</b> of which are buttons"));
|
||||
|
||||
// select the first element for auto-navigation
|
||||
this.root.Root.SelectElement(this.root.GetChildren().First(c => c.CanBeSelected));
|
||||
this.root.Root.SelectElement(this.root.Children.First(c => c.CanBeSelected));
|
||||
}
|
||||
|
||||
// This method is used by the wobbling button (see above)
|
||||
|
|
|
@ -143,7 +143,7 @@ namespace MLEM.Ui.Elements {
|
|||
this.GetGamepadNextElement = (dir, usualNext) => {
|
||||
// Force navigate down to our first child if we're open
|
||||
if (this.IsOpen && dir == Direction2.Down)
|
||||
return this.Panel.GetChildren().FirstOrDefault(c => c.CanBeSelected) ?? usualNext;
|
||||
return this.Panel.Children.FirstOrDefault(c => c.CanBeSelected) ?? usualNext;
|
||||
return usualNext;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -497,7 +497,7 @@ namespace MLEM.Ui.Elements {
|
|||
/// A list of all of this element's direct children.
|
||||
/// Use <see cref="AddChild{T}"/> or <see cref="RemoveChild"/> to manipulate this list while calling all of the necessary callbacks.
|
||||
/// </summary>
|
||||
protected readonly IList<Element> Children;
|
||||
public readonly IList<Element> Children;
|
||||
/// <summary>
|
||||
/// A list of all of the <see cref="UiAnimation"/> instances that are currently playing.
|
||||
/// You can modify this collection through <see cref="PlayAnimation"/> and <see cref="StopAnimation"/>.
|
||||
|
|
Loading…
Reference in a new issue