mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-12-24 01:09:23 +01:00
Fixed tooltips sometimes ignoring manually set IsHidden values
This commit is contained in:
parent
37f0470e4f
commit
df0ad68837
3 changed files with 6 additions and 4 deletions
|
@ -70,6 +70,7 @@ Fixes
|
|||
- Fixed RootElement.CanSelectContent and Element.IsSelected returning incorrect results when CanBeSelected changes
|
||||
- Fixed dropdowns with some non-selectable children failing to navigate when using gamepad controls
|
||||
- Fixed UiMetrics.ForceAreaUpdateTime being inaccurate for nested elements
|
||||
- Fixed tooltips sometimes ignoring manually set IsHidden values
|
||||
|
||||
Removals
|
||||
- Marked StyleProp equality members as obsolete
|
||||
|
|
|
@ -151,7 +151,7 @@ namespace MLEM.Ui.Elements {
|
|||
/// Set this property to <c>true</c> to cause this element to be hidden.
|
||||
/// Hidden elements don't receive input events, aren't rendered and don't factor into auto-anchoring.
|
||||
/// </summary>
|
||||
public bool IsHidden {
|
||||
public virtual bool IsHidden {
|
||||
get => this.isHidden;
|
||||
set {
|
||||
if (this.isHidden == value)
|
||||
|
|
|
@ -29,6 +29,9 @@ namespace MLEM.Ui.Elements {
|
|||
/// Note that <see cref="MouseOffset"/> is still applied with this value set.
|
||||
/// </summary>
|
||||
public virtual Vector2? SnapPosition { get; set; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool IsHidden => this.autoHidden || base.IsHidden;
|
||||
|
||||
private TimeSpan delayCountdown;
|
||||
private bool autoHidden;
|
||||
|
@ -167,10 +170,8 @@ namespace MLEM.Ui.Elements {
|
|||
}
|
||||
}
|
||||
if (this.autoHidden != shouldBeHidden) {
|
||||
// only auto-hide if IsHidden wasn't changed manually
|
||||
if (this.IsHidden == this.autoHidden)
|
||||
this.IsHidden = shouldBeHidden;
|
||||
this.autoHidden = shouldBeHidden;
|
||||
this.SetAreaDirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue