mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 05:02:55 +08:00
Merge pull request #4108 from peppy/fix-toolbar-padding-regression
Fix overlays not being correctly offset by toolbar padding
This commit is contained in:
commit
f33f91dadb
@ -364,11 +364,11 @@ namespace osu.Game
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
mainContent = new Container
|
||||
overlayContent = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
},
|
||||
overlayContent = new Container { RelativeSizeAxes = Axes.Both, Depth = float.MinValue },
|
||||
floatingOverlayContent = new Container { RelativeSizeAxes = Axes.Both, Depth = float.MinValue },
|
||||
idleTracker = new IdleTracker(6000)
|
||||
});
|
||||
|
||||
@ -387,32 +387,32 @@ namespace osu.Game
|
||||
CloseAllOverlays(false);
|
||||
intro?.ChildScreen?.MakeCurrent();
|
||||
},
|
||||
}, overlayContent.Add);
|
||||
}, floatingOverlayContent.Add);
|
||||
|
||||
loadComponentSingleFile(volume = new VolumeOverlay(), overlayContent.Add);
|
||||
loadComponentSingleFile(volume = new VolumeOverlay(), floatingOverlayContent.Add);
|
||||
loadComponentSingleFile(onscreenDisplay = new OnScreenDisplay(), Add);
|
||||
|
||||
loadComponentSingleFile(screenshotManager, Add);
|
||||
|
||||
//overlay elements
|
||||
loadComponentSingleFile(direct = new DirectOverlay { Depth = -1 }, mainContent.Add);
|
||||
loadComponentSingleFile(social = new SocialOverlay { Depth = -1 }, mainContent.Add);
|
||||
loadComponentSingleFile(direct = new DirectOverlay { Depth = -1 }, overlayContent.Add);
|
||||
loadComponentSingleFile(social = new SocialOverlay { Depth = -1 }, overlayContent.Add);
|
||||
loadComponentSingleFile(channelManager = new ChannelManager(), AddInternal);
|
||||
loadComponentSingleFile(chatOverlay = new ChatOverlay { Depth = -1 }, mainContent.Add);
|
||||
loadComponentSingleFile(chatOverlay = new ChatOverlay { Depth = -1 }, overlayContent.Add);
|
||||
loadComponentSingleFile(settings = new MainSettings
|
||||
{
|
||||
GetToolbarHeight = () => ToolbarOffset,
|
||||
Depth = -1
|
||||
}, overlayContent.Add);
|
||||
loadComponentSingleFile(userProfile = new UserProfileOverlay { Depth = -2 }, mainContent.Add);
|
||||
loadComponentSingleFile(beatmapSetOverlay = new BeatmapSetOverlay { Depth = -3 }, mainContent.Add);
|
||||
}, floatingOverlayContent.Add);
|
||||
loadComponentSingleFile(userProfile = new UserProfileOverlay { Depth = -2 }, overlayContent.Add);
|
||||
loadComponentSingleFile(beatmapSetOverlay = new BeatmapSetOverlay { Depth = -3 }, overlayContent.Add);
|
||||
loadComponentSingleFile(musicController = new MusicController
|
||||
{
|
||||
Depth = -5,
|
||||
Position = new Vector2(0, Toolbar.HEIGHT),
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
}, overlayContent.Add);
|
||||
}, floatingOverlayContent.Add);
|
||||
|
||||
loadComponentSingleFile(notifications = new NotificationOverlay
|
||||
{
|
||||
@ -420,22 +420,22 @@ namespace osu.Game
|
||||
Depth = -4,
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
}, overlayContent.Add);
|
||||
}, floatingOverlayContent.Add);
|
||||
|
||||
loadComponentSingleFile(accountCreation = new AccountCreationOverlay
|
||||
{
|
||||
Depth = -6,
|
||||
}, overlayContent.Add);
|
||||
}, floatingOverlayContent.Add);
|
||||
|
||||
loadComponentSingleFile(dialogOverlay = new DialogOverlay
|
||||
{
|
||||
Depth = -7,
|
||||
}, overlayContent.Add);
|
||||
}, floatingOverlayContent.Add);
|
||||
|
||||
loadComponentSingleFile(externalLinkOpener = new ExternalLinkOpener
|
||||
{
|
||||
Depth = -8,
|
||||
}, overlayContent.Add);
|
||||
}, floatingOverlayContent.Add);
|
||||
|
||||
dependencies.Cache(idleTracker);
|
||||
dependencies.Cache(settings);
|
||||
@ -654,10 +654,10 @@ namespace osu.Game
|
||||
|
||||
public bool OnReleased(GlobalAction action) => false;
|
||||
|
||||
private Container mainContent;
|
||||
|
||||
private Container overlayContent;
|
||||
|
||||
private Container floatingOverlayContent;
|
||||
|
||||
private OsuScreen currentScreen;
|
||||
private FrameworkConfigManager frameworkConfig;
|
||||
private ScalingContainer screenContainer;
|
||||
@ -701,6 +701,7 @@ namespace osu.Game
|
||||
Beatmap.Disabled = applyBeatmapRulesetRestrictions;
|
||||
|
||||
screenContainer.Padding = new MarginPadding { Top = ToolbarOffset };
|
||||
overlayContent.Padding = new MarginPadding { Top = ToolbarOffset };
|
||||
|
||||
MenuCursorContainer.CanShowCursor = currentScreen?.CursorVisible ?? false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user