2020-02-14 14:36:16 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
#nullable disable
|
|
|
|
|
2020-02-14 14:36:16 +08:00
|
|
|
using osu.Framework.Bindables;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
|
|
|
namespace osu.Game.Graphics.Containers
|
|
|
|
{
|
|
|
|
public abstract class OsuRearrangeableListContainer<TModel> : RearrangeableListContainer<TModel>
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Whether any item is currently being dragged. Used to hide other items' drag handles.
|
|
|
|
/// </summary>
|
2020-09-08 15:36:36 +08:00
|
|
|
protected readonly BindableBool DragActive = new BindableBool();
|
2020-02-14 14:36:16 +08:00
|
|
|
|
|
|
|
protected override ScrollContainer<Drawable> CreateScrollContainer() => new OsuScrollContainer();
|
|
|
|
|
|
|
|
protected sealed override RearrangeableListItem<TModel> CreateDrawable(TModel item) => CreateOsuDrawable(item).With(d =>
|
|
|
|
{
|
2020-09-08 15:36:36 +08:00
|
|
|
d.DragActive.BindTo(DragActive);
|
2020-02-14 14:36:16 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
protected abstract OsuRearrangeableListItem<TModel> CreateOsuDrawable(TModel item);
|
|
|
|
}
|
|
|
|
}
|