diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/BottomBar.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/BottomBar.cs new file mode 100644 index 000000000..36f0dc091 --- /dev/null +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/BottomBar.cs @@ -0,0 +1,74 @@ +// Copyright (c) andy840119 . Licensed under the GPL Licence. +// See the LICENCE file in the repository root for full licence text. + +using osu.Framework.Allocation; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Effects; +using osu.Framework.Graphics.Shapes; +using osu.Game.Overlays; +using osu.Game.Screens.Edit.Components; +using osu.Game.Screens.Edit.Components.Timelines.Summary; +using osuTK.Graphics; + +namespace osu.Game.Rulesets.Karaoke.Screens.Edit; + +/// +/// Copy the Component from the +/// +public partial class BottomBar : CompositeDrawable +{ + private readonly Box background; + + public BottomBar() + { + Anchor = Anchor.BottomLeft; + Origin = Anchor.BottomLeft; + + RelativeSizeAxes = Axes.X; + + Height = 60; + + Masking = true; + EdgeEffect = new EdgeEffectParameters + { + Colour = Color4.Black.Opacity(0.2f), + Type = EdgeEffectType.Shadow, + Radius = 10f, + }; + + InternalChildren = new Drawable[] + { + background = new Box + { + RelativeSizeAxes = Axes.Both, + }, + new GridContainer + { + RelativeSizeAxes = Axes.Both, + ColumnDimensions = new[] + { + new Dimension(GridSizeMode.Absolute, 170), + new Dimension(), + new Dimension(GridSizeMode.Absolute, 220), + }, + Content = new[] + { + new Drawable[] + { + new TimeInfoContainer { RelativeSizeAxes = Axes.Both }, + new SummaryTimeline { RelativeSizeAxes = Axes.Both }, + new PlaybackControl { RelativeSizeAxes = Axes.Both }, + }, + }, + }, + }; + } + + [BackgroundDependencyLoader] + private void load(OverlayColourProvider colourProvider) + { + background.Colour = colourProvider.Background4; + } +} diff --git a/osu.Game.Rulesets.Karaoke/Screens/Edit/GenericEditor.cs b/osu.Game.Rulesets.Karaoke/Screens/Edit/GenericEditor.cs index b6077f06d..b6bd3ed8f 100644 --- a/osu.Game.Rulesets.Karaoke/Screens/Edit/GenericEditor.cs +++ b/osu.Game.Rulesets.Karaoke/Screens/Edit/GenericEditor.cs @@ -66,7 +66,7 @@ private void load(OsuColour colours, EditorBeatmap editorBeatmap, BindableBeatDi AddInternal(new OsuContextMenuContainer { RelativeSizeAxes = Axes.Both, - Children = new[] + Children = new Drawable[] { new Container { @@ -101,59 +101,7 @@ private void load(OsuColour colours, EditorBeatmap editorBeatmap, BindableBeatDi }, }, }, - new Container - { - Name = "Bottom bar", - Anchor = Anchor.BottomLeft, - Origin = Anchor.BottomLeft, - RelativeSizeAxes = Axes.X, - Height = 60, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = colours.Gray2, - }, - new Container - { - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Vertical = 5, Horizontal = 10 }, - Child = new GridContainer - { - RelativeSizeAxes = Axes.Both, - ColumnDimensions = new[] - { - new Dimension(GridSizeMode.Absolute, 220), - new Dimension(), - new Dimension(GridSizeMode.Absolute, 220), - }, - Content = new[] - { - new Drawable[] - { - new Container - { - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Right = 10 }, - Child = new TimeInfoContainer { RelativeSizeAxes = Axes.Both }, - }, - new SummaryTimeline - { - RelativeSizeAxes = Axes.Both, - }, - new Container - { - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Left = 10 }, - Child = new PlaybackControl { RelativeSizeAxes = Axes.Both }, - }, - }, - }, - }, - }, - }, - }, + new BottomBar(), }, });