mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 09:42:54 +08:00
Handle controls with dragging state wrapped in underlying components
I'm not 100% sure about this approach but it'll do for now.
This commit is contained in:
parent
f4c7a332c3
commit
648e7f6bbc
@ -119,6 +119,6 @@ namespace osu.Game.Overlays
|
||||
/// <summary>
|
||||
/// Whether the given control is currently active, by checking whether it's hovered or dragged.
|
||||
/// </summary>
|
||||
private bool isControlActive(TControl control) => control.IsHovered || control.IsDragged;
|
||||
private bool isControlActive(TControl control) => control.IsHovered || control.IsDragged || (control is ISettingsItem item && item.IsControlDragged);
|
||||
}
|
||||
}
|
||||
|
@ -14,5 +14,10 @@ namespace osu.Game.Overlays.Settings
|
||||
/// Invoked when the setting value has changed.
|
||||
/// </summary>
|
||||
event Action SettingChanged;
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether the UI control is currently in a dragged state.
|
||||
/// </summary>
|
||||
bool IsControlDragged { get; }
|
||||
}
|
||||
}
|
||||
|
@ -105,6 +105,8 @@ namespace osu.Game.Overlays.Settings
|
||||
|
||||
public BindableBool Expanded { get; } = new BindableBool(true);
|
||||
|
||||
public bool IsControlDragged => Control.IsDragged;
|
||||
|
||||
public event Action SettingChanged;
|
||||
|
||||
public virtual IEnumerable<string> FilterTerms => Keywords == null ? new[] { LabelText.ToString() } : new List<string>(Keywords) { LabelText.ToString() }.ToArray();
|
||||
|
Loading…
Reference in New Issue
Block a user