mirror of https://github.com/ppy/osu
Allow interacting with playlist item buttons when not selected
This commit is contained in:
parent
6f8a3e15d8
commit
1f6e1cbe56
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue