1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-22 00:32:55 +08:00
osu-lazer/osu.Game/Screens/Edit/Components/EditorSidebar.cs

60 lines
1.8 KiB
C#
Raw Normal View History

2022-03-15 15:48:14 +08:00
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
2022-03-15 15:35:46 +08:00
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics.Containers;
using osu.Game.Overlays;
namespace osu.Game.Screens.Edit.Components
{
/// <summary>
/// A sidebar area that can be attached to the left or right edge of the screen.
/// Houses scrolling sectionised content.
/// </summary>
2022-11-24 13:32:20 +08:00
internal partial class EditorSidebar : Container<EditorSidebarSection>
2022-03-15 15:35:46 +08:00
{
public const float WIDTH = 250;
public const float PADDING = 3;
2022-03-15 15:35:46 +08:00
private readonly Box background;
protected override Container<EditorSidebarSection> Content { get; }
public EditorSidebar()
{
Width = WIDTH;
2022-03-15 15:35:46 +08:00
RelativeSizeAxes = Axes.Y;
InternalChildren = new Drawable[]
{
background = new Box
{
RelativeSizeAxes = Axes.Both,
},
new OsuScrollContainer
{
ScrollbarOverlapsContent = false,
RelativeSizeAxes = Axes.Both,
Child = Content = new FillFlowContainer<EditorSidebarSection>
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding(PADDING),
2022-03-15 15:35:46 +08:00
Direction = FillDirection.Vertical,
},
}
};
}
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
{
background.Colour = colourProvider.Background5;
}
}
}