mirror of
https://github.com/ppy/osu
synced 2024-12-27 09:23:15 +00: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.
|
||||
|
||||
using System;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Input.Events;
|
||||
using osu.Framework.Utils;
|
||||
using osu.Game.Graphics.Containers;
|
||||
@ -12,6 +13,8 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
{
|
||||
public const float HEIGHT = 200;
|
||||
|
||||
protected override ScrollbarContainer CreateScrollbar(Direction direction) => new ExpandedContentScrollbar(direction);
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
@ -53,5 +56,22 @@ namespace osu.Game.Beatmaps.Drawables.Cards
|
||||
|
||||
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…
Reference in New Issue
Block a user