mirror of https://github.com/ppy/osu
Add placement-dependent horizontal screen offset properties
This commit is contained in:
parent
067ff0e0ad
commit
8e8e0fb8d8
|
@ -30,6 +30,11 @@ public class NotificationOverlay : OsuFocusedOverlayContainer, INamedOverlayComp
|
|||
|
||||
private FlowContainer<NotificationSection> sections;
|
||||
|
||||
/// <summary>
|
||||
/// A horizontal offset to apply to the game-wide screen.
|
||||
/// </summary>
|
||||
public float HorizontalScreenOffset => -width + X;
|
||||
|
||||
/// <summary>
|
||||
/// Provide a source for the toolbar height.
|
||||
/// </summary>
|
||||
|
|
|
@ -21,6 +21,8 @@ public class SettingsOverlay : SettingsPanel, INamedOverlayComponent
|
|||
public LocalisableString Title => SettingsStrings.HeaderTitle;
|
||||
public LocalisableString Description => SettingsStrings.HeaderDescription;
|
||||
|
||||
public override float HorizontalScreenOffset => base.HorizontalScreenOffset + (lastOpenedSubPanel?.HorizontalScreenOffset ?? 0f);
|
||||
|
||||
protected override IEnumerable<SettingsSection> CreateSections() => new SettingsSection[]
|
||||
{
|
||||
new GeneralSection(),
|
||||
|
|
|
@ -34,6 +34,11 @@ public abstract class SettingsPanel : OsuFocusedOverlayContainer
|
|||
|
||||
protected override Container<Drawable> Content => ContentContainer;
|
||||
|
||||
/// <summary>
|
||||
/// A horizontal offset to apply to the game-wide screen.
|
||||
/// </summary>
|
||||
public virtual float HorizontalScreenOffset => (WIDTH + Content?.X) ?? 0f;
|
||||
|
||||
protected Sidebar Sidebar;
|
||||
private SidebarButton selectedSidebarButton;
|
||||
|
||||
|
@ -64,6 +69,7 @@ private void load()
|
|||
{
|
||||
InternalChild = ContentContainer = new NonMaskedContent
|
||||
{
|
||||
X = -WIDTH + ExpandedPosition,
|
||||
Width = WIDTH,
|
||||
RelativeSizeAxes = Axes.Y,
|
||||
Children = new Drawable[]
|
||||
|
|
Loading…
Reference in New Issue