1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 17:47:29 +08:00

Add editor header

This commit is contained in:
Dean Herbert 2023-07-14 16:55:12 +09:00
parent 57abb15724
commit e6b8cd0c06

View File

@ -3,6 +3,9 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Graphics.UserInterface;
using osu.Framework.Input.Events;
using osu.Game.Graphics;
@ -14,19 +17,56 @@ namespace osu.Game.Screens.Edit.Components.Menus
{
public partial class EditorMenuBar : OsuMenu
{
private const float heading_area = 114;
public EditorMenuBar()
: base(Direction.Horizontal, true)
{
RelativeSizeAxes = Axes.X;
MaskingContainer.CornerRadius = 0;
ItemsContainer.Padding = new MarginPadding { Left = 100 };
ItemsContainer.Padding = new MarginPadding { Left = heading_area };
}
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
private void load(OverlayColourProvider colourProvider, TextureStore textures)
{
BackgroundColour = colourProvider.Background3;
TextFlowContainer text;
AddRangeInternal(new[]
{
new Container
{
RelativeSizeAxes = Axes.Y,
Width = heading_area,
Padding = new MarginPadding(8),
Children = new Drawable[]
{
new Sprite
{
Size = new Vector2(26),
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
Texture = textures.Get("Icons/Hexacons/editor"),
},
text = new TextFlowContainer
{
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
AutoSizeAxes = Axes.Both,
}
}
},
});
text.AddText("osu!", t => t.Font = OsuFont.TorusAlternate);
text.AddText("editor", t =>
{
t.Font = OsuFont.TorusAlternate;
t.Colour = colourProvider.Highlight1;
});
}
protected override Framework.Graphics.UserInterface.Menu CreateSubMenu() => new SubMenu();