mirror of
https://github.com/ppy/osu
synced 2024-12-23 23:33:36 +00:00
53 lines
1.6 KiB
C#
53 lines
1.6 KiB
C#
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>
|
|
internal class EditorSidebar : Container<EditorSidebarSection>
|
|
{
|
|
private readonly Box background;
|
|
|
|
protected override Container<EditorSidebarSection> Content { get; }
|
|
|
|
public EditorSidebar()
|
|
{
|
|
Width = 250;
|
|
RelativeSizeAxes = Axes.Y;
|
|
|
|
InternalChildren = new Drawable[]
|
|
{
|
|
background = new Box
|
|
{
|
|
RelativeSizeAxes = Axes.Both,
|
|
},
|
|
new OsuScrollContainer
|
|
{
|
|
Padding = new MarginPadding { Left = 20 },
|
|
ScrollbarOverlapsContent = false,
|
|
RelativeSizeAxes = Axes.Both,
|
|
Child = Content = new FillFlowContainer<EditorSidebarSection>
|
|
{
|
|
RelativeSizeAxes = Axes.X,
|
|
AutoSizeAxes = Axes.Y,
|
|
Direction = FillDirection.Vertical,
|
|
},
|
|
}
|
|
};
|
|
}
|
|
|
|
[BackgroundDependencyLoader]
|
|
private void load(OverlayColourProvider colourProvider)
|
|
{
|
|
background.Colour = colourProvider.Background5;
|
|
}
|
|
}
|
|
}
|