1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 10:33:30 +08:00

Merge pull request #4546 from Joehuu/fix-music-controller-offset

Fix offset of music controller when toolbar is hidden

Co-authored-by: Dean Herbert <pe@ppy.sh>
Co-authored-by: Dan Balasescu <1329837+smoogipoo@users.noreply.github.com>
This commit is contained in:
Dean Herbert 2019-03-29 14:26:28 +09:00 committed by GitHub
commit a1fa497ec0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -15,7 +15,6 @@ using osu.Framework.Allocation;
using osu.Game.Overlays.Toolbar;
using osu.Game.Screens;
using osu.Game.Screens.Menu;
using osuTK;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
@ -442,7 +441,7 @@ namespace osu.Game
loadComponentSingleFile(musicController = new MusicController
{
Position = new Vector2(0, Toolbar.HEIGHT),
GetToolbarHeight = () => ToolbarOffset,
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
}, floatingOverlayContent.Add);

View File

@ -56,6 +56,11 @@ namespace osu.Game.Overlays
private readonly Bindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
/// <summary>
/// Provide a source for the toolbar height.
/// </summary>
public Func<float> GetToolbarHeight;
public MusicController()
{
Width = 400;
@ -244,6 +249,8 @@ namespace osu.Game.Overlays
{
base.UpdateAfterChildren();
Height = dragContainer.Height;
dragContainer.Padding = new MarginPadding { Top = GetToolbarHeight?.Invoke() ?? 0 };
}
protected override void Update()