Allow interacting with playlist item buttons when not selected

This commit is contained in:
Dean Herbert 2024-01-09 14:45:21 +09:00
parent 6f8a3e15d8
commit 1f6e1cbe56
No known key found for this signature in database
2 changed files with 18 additions and 4 deletions

View File

@ -165,7 +165,11 @@ protected sealed override OsuRearrangeableListItem<PlaylistItem> CreateOsuDrawab
{
d.SelectedItem.BindTarget = SelectedItem;
d.RequestDeletion = i => RequestDeletion?.Invoke(i);
d.RequestResults = i => RequestResults?.Invoke(i);
d.RequestResults = i =>
{
SelectedItem.Value = i;
RequestResults?.Invoke(i);
};
d.RequestEdit = i => RequestEdit?.Invoke(i);
d.AllowReordering = AllowReordering;
d.AllowDeletion = AllowDeletion;

View File

@ -118,8 +118,6 @@ public partial class DrawableRoomPlaylistItem : OsuRearrangeableListItem<Playlis
[Resolved(CanBeNull = true)]
private ManageCollectionsDialog manageCollectionsDialog { get; set; }
protected override bool ShouldBeConsideredForInput(Drawable child) => AllowReordering || AllowDeletion || !AllowSelection || SelectedItem.Value == Model;
public DrawableRoomPlaylistItem(PlaylistItem item)
: base(item)
{
@ -367,7 +365,7 @@ protected override Drawable CreateContent()
AutoSizeAxes = Axes.Both,
Margin = new MarginPadding { Left = 8, Right = 8 },
},
mainFillFlow = new FillFlowContainer
mainFillFlow = new MainFlow(() => SelectedItem.Value == Model)
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
@ -670,5 +668,17 @@ public TooltipArea(OwnerAvatar avatar)
public LocalisableString TooltipText => avatar.TooltipText;
}
}
public partial class MainFlow : FillFlowContainer
{
private readonly Func<bool> isSelected;
public override bool PropagatePositionalInputSubTree => isSelected();
public MainFlow(Func<bool> isSelected)
{
this.isSelected = isSelected;
}
}
}
}