mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 20:58:34 +01:00
return the element added by Dropdown
This commit is contained in:
parent
5c4c8f3123
commit
6c3e9116ff
1 changed files with 4 additions and 3 deletions
|
@ -69,8 +69,8 @@ namespace MLEM.Ui.Elements {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="text">The text to display</param>
|
/// <param name="text">The text to display</param>
|
||||||
/// <param name="pressed">The resulting paragraph's <see cref="Element.OnPressed"/> event</param>
|
/// <param name="pressed">The resulting paragraph's <see cref="Element.OnPressed"/> event</param>
|
||||||
public void AddElement(string text, GenericCallback pressed = null) {
|
public Element AddElement(string text, GenericCallback pressed = null) {
|
||||||
this.AddElement(p => text, pressed);
|
return this.AddElement(p => text, pressed);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -79,7 +79,7 @@ namespace MLEM.Ui.Elements {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="text">The text to display</param>
|
/// <param name="text">The text to display</param>
|
||||||
/// <param name="pressed">The resulting paragraph's <see cref="Element.OnPressed"/> event</param>
|
/// <param name="pressed">The resulting paragraph's <see cref="Element.OnPressed"/> event</param>
|
||||||
public void AddElement(Paragraph.TextCallback text, GenericCallback pressed = null) {
|
public Element AddElement(Paragraph.TextCallback text, GenericCallback pressed = null) {
|
||||||
var paragraph = new Paragraph(Anchor.AutoLeft, 1, text) {
|
var paragraph = new Paragraph(Anchor.AutoLeft, 1, text) {
|
||||||
CanBeMoused = true,
|
CanBeMoused = true,
|
||||||
CanBeSelected = true,
|
CanBeSelected = true,
|
||||||
|
@ -90,6 +90,7 @@ namespace MLEM.Ui.Elements {
|
||||||
paragraph.OnMouseEnter += e => paragraph.TextColor = Color.LightGray;
|
paragraph.OnMouseEnter += e => paragraph.TextColor = Color.LightGray;
|
||||||
paragraph.OnMouseExit += e => paragraph.TextColor = Color.White;
|
paragraph.OnMouseExit += e => paragraph.TextColor = Color.White;
|
||||||
this.AddElement(paragraph);
|
this.AddElement(paragraph);
|
||||||
|
return paragraph;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue