mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 12:58:33 +01:00
Removed AutoHideCondition (partially reverts d5d3297
)
This commit is contained in:
parent
d5d3297271
commit
45c668c992
2 changed files with 2 additions and 12 deletions
|
@ -57,7 +57,7 @@ Additions
|
|||
- Added ScrollBar.MouseDragScrolling
|
||||
- Added Panel.ScrollToElement
|
||||
- Added ElementHelper.MakeGrid
|
||||
- Added Element.AutoHideCondition and Button.AutoDisableCondition
|
||||
- Added Button.AutoDisableCondition
|
||||
|
||||
Improvements
|
||||
- Allow elements to auto-adjust their size even when their children are aligned oddly
|
||||
|
|
|
@ -172,15 +172,9 @@ namespace MLEM.Ui.Elements {
|
|||
/// <summary>
|
||||
/// 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.
|
||||
/// If this value changes often, consider using <see cref="AutoHideCondition"/> to set it automatically.
|
||||
/// </summary>
|
||||
public virtual bool IsHidden {
|
||||
get {
|
||||
// instead of just returning, we set IsHidden here because we might have to set our area dirty
|
||||
if (this.AutoHideCondition != null)
|
||||
this.IsHidden = this.AutoHideCondition(this);
|
||||
return this.isHidden;
|
||||
}
|
||||
get => this.isHidden;
|
||||
set {
|
||||
if (this.isHidden == value)
|
||||
return;
|
||||
|
@ -436,10 +430,6 @@ namespace MLEM.Ui.Elements {
|
|||
/// </summary>
|
||||
[Obsolete("OnDisposed will be removed in a future update. To unregister custom event handlers, use OnRemovedFromUi instead.")]
|
||||
public GenericCallback OnDisposed;
|
||||
/// <summary>
|
||||
/// An optional function that can be used to set <see cref="IsHidden"/> automatically based on a user-defined condition. This removes the need to hide an element based on a condition in <see cref="Element.OnUpdated"/> or manually.
|
||||
/// </summary>
|
||||
public Func<Element, bool> AutoHideCondition;
|
||||
|
||||
/// <summary>
|
||||
/// A list of all of this element's direct children.
|
||||
|
|
Loading…
Reference in a new issue