mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-25 05:58:35 +01:00
Compare commits
2 commits
be26a2ebc2
...
c78bafd000
Author | SHA1 | Date | |
---|---|---|---|
c78bafd000 | |||
783da33107 |
2 changed files with 7 additions and 6 deletions
|
@ -17,9 +17,13 @@ Additions
|
|||
Additions
|
||||
- Added Element.AutoNavGroup which allows forming groups for auto-navigation
|
||||
|
||||
Improvements
|
||||
- Ensure that Element.IsMouseOver is always accurate by making it an auto-property
|
||||
|
||||
Fixes
|
||||
- Fixed auto-nav tooltip displaying on the selected element even when not in auto-nav mode
|
||||
- Fixed radio buttons not unchecking all other radio buttons with the same root element
|
||||
- Fixed elements not being deselected when removed through RemoveChild
|
||||
|
||||
## 5.3.0
|
||||
### MLEM
|
||||
|
|
|
@ -240,7 +240,7 @@ namespace MLEM.Ui.Elements {
|
|||
/// <summary>
|
||||
/// Stores whether this element is currently being moused over or touched.
|
||||
/// </summary>
|
||||
public bool IsMouseOver { get; protected set; }
|
||||
public bool IsMouseOver => this.Controls.MousedElement == this || this.Controls.TouchedElement == this;
|
||||
/// <summary>
|
||||
/// Returns whether this element is its <see cref="Root"/>'s <see cref="RootElement.SelectedElement"/>.
|
||||
/// </summary>
|
||||
|
@ -439,11 +439,6 @@ namespace MLEM.Ui.Elements {
|
|||
this.size = size;
|
||||
|
||||
this.Children = new ReadOnlyCollection<Element>(this.children);
|
||||
|
||||
this.OnMouseEnter += element => this.IsMouseOver = true;
|
||||
this.OnMouseExit += element => this.IsMouseOver = false;
|
||||
this.OnTouchEnter += element => this.IsMouseOver = true;
|
||||
this.OnTouchExit += element => this.IsMouseOver = false;
|
||||
this.GetTabNextElement += (backward, next) => next;
|
||||
this.GetGamepadNextElement += (dir, next) => next;
|
||||
|
||||
|
@ -485,6 +480,8 @@ namespace MLEM.Ui.Elements {
|
|||
/// <param name="element">The child element to remove</param>
|
||||
public virtual void RemoveChild(Element element) {
|
||||
this.children.Remove(element);
|
||||
if (this.Root?.SelectedElement == element)
|
||||
this.Root.SelectElement(null);
|
||||
// set area dirty here so that a dirty call is made
|
||||
// upwards to us if the element is auto-positioned
|
||||
element.SetAreaDirty();
|
||||
|
|
Loading…
Reference in a new issue