mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 20:58:34 +01:00
Fixed Element.IsSelected returning incorrect results when CanBeSelected changes
This commit is contained in:
parent
4aff5a2875
commit
1f4f0cfa44
2 changed files with 3 additions and 5 deletions
|
@ -61,7 +61,7 @@ Fixes
|
||||||
- Fixed UiControls allowing for non-selectable or non-mouseable elements to be marked as selected or moused
|
- Fixed UiControls allowing for non-selectable or non-mouseable elements to be marked as selected or moused
|
||||||
- Fixed buttons and checkboxes changing their CanBeSelected and CanBePressed values when being disabled
|
- Fixed buttons and checkboxes changing their CanBeSelected and CanBePressed values when being disabled
|
||||||
- Fixed children of Panel scroll bars also being scrolled
|
- Fixed children of Panel scroll bars also being scrolled
|
||||||
- Fixed RootElement.CanSelectContent returning incorrect results when CanBeSelected changes in children
|
- Fixed RootElement.CanSelectContent and Element.IsSelected returning incorrect results when CanBeSelected changes
|
||||||
|
|
||||||
Removals
|
Removals
|
||||||
- Marked StyleProp equality members as obsolete
|
- Marked StyleProp equality members as obsolete
|
||||||
|
|
|
@ -241,9 +241,9 @@ namespace MLEM.Ui.Elements {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsMouseOver { get; protected set; }
|
public bool IsMouseOver { get; protected set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Stores whether this element is its <see cref="Root"/>'s <see cref="RootElement.SelectedElement"/>.
|
/// Returns whether this element is its <see cref="Root"/>'s <see cref="RootElement.SelectedElement"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsSelected { get; protected set; }
|
public bool IsSelected => this.Root.SelectedElement == this;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns whether this element's <see cref="SetAreaDirty"/> method has been recently called and its area has not been updated since then using <see cref="UpdateAreaIfDirty"/> or <see cref="ForceUpdateArea"/>.
|
/// Returns whether this element's <see cref="SetAreaDirty"/> method has been recently called and its area has not been updated since then using <see cref="UpdateAreaIfDirty"/> or <see cref="ForceUpdateArea"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -436,8 +436,6 @@ namespace MLEM.Ui.Elements {
|
||||||
this.OnMouseExit += element => this.IsMouseOver = false;
|
this.OnMouseExit += element => this.IsMouseOver = false;
|
||||||
this.OnTouchEnter += element => this.IsMouseOver = true;
|
this.OnTouchEnter += element => this.IsMouseOver = true;
|
||||||
this.OnTouchExit += element => this.IsMouseOver = false;
|
this.OnTouchExit += element => this.IsMouseOver = false;
|
||||||
this.OnSelected += element => this.IsSelected = true;
|
|
||||||
this.OnDeselected += element => this.IsSelected = false;
|
|
||||||
this.GetTabNextElement += (backward, next) => next;
|
this.GetTabNextElement += (backward, next) => next;
|
||||||
this.GetGamepadNextElement += (dir, next) => next;
|
this.GetGamepadNextElement += (dir, next) => next;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue