mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 01:47:33 +08:00
Fix expanded content scrollbar inadvertently hiding expanded content
This commit is contained in:
parent
77748a5f93
commit
247c557eaf
@ -2,6 +2,7 @@
|
|||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Input.Events;
|
using osu.Framework.Input.Events;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Graphics.Containers;
|
using osu.Game.Graphics.Containers;
|
||||||
@ -12,6 +13,8 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
|||||||
{
|
{
|
||||||
public const float HEIGHT = 200;
|
public const float HEIGHT = 200;
|
||||||
|
|
||||||
|
protected override ScrollbarContainer CreateScrollbar(Direction direction) => new ExpandedContentScrollbar(direction);
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
@ -53,5 +56,22 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
|||||||
|
|
||||||
return base.OnScroll(e);
|
return base.OnScroll(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class ExpandedContentScrollbar : OsuScrollbar
|
||||||
|
{
|
||||||
|
public ExpandedContentScrollbar(Direction scrollDir)
|
||||||
|
: base(scrollDir)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool OnHover(HoverEvent e)
|
||||||
|
{
|
||||||
|
base.OnHover(e);
|
||||||
|
// do not handle hover, as handling hover would make the beatmap card's expanded content not-hovered
|
||||||
|
// and therefore cause it to hide when trying to drag the scroll bar.
|
||||||
|
// see: `BeatmapCardContent.dropdownContent` and its `Unhovered` handler.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user