Make `TimingScreen` use rounded screen and adjust spacing/padding

This commit is contained in:
Dean Herbert 2021-04-19 14:11:26 +09:00
parent e143afb598
commit f4baff9e04
4 changed files with 37 additions and 39 deletions

View File

@ -9,6 +9,7 @@
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
using osu.Game.Overlays;
using osuTK.Graphics;
namespace osu.Game.Screens.Edit
@ -93,10 +94,10 @@ public RowBackground(object item)
private Color4 colourSelected;
[BackgroundDependencyLoader]
private void load(OsuColour colours)
private void load(OverlayColourProvider colours)
{
hoveredBackground.Colour = colourHover = colours.BlueDarker;
colourSelected = colours.YellowDarker;
hoveredBackground.Colour = colourHover = colours.Background3;
colourSelected = colours.Background1;
}
private bool selected;

View File

@ -6,15 +6,15 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Overlays;
namespace osu.Game.Screens.Edit.Timing
{
public class ControlPointSettings : CompositeDrawable
{
[BackgroundDependencyLoader]
private void load(OsuColour colours)
private void load(OverlayColourProvider colours)
{
RelativeSizeAxes = Axes.Both;
@ -22,7 +22,7 @@ private void load(OsuColour colours)
{
new Box
{
Colour = colours.Gray3,
Colour = colours.Background4,
RelativeSizeAxes = Axes.Both,
},
new OsuScrollContainer

View File

@ -8,8 +8,9 @@
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Game.Overlays;
using osuTK;
namespace osu.Game.Screens.Edit.Timing
{
@ -23,7 +24,7 @@ internal abstract class Section<T> : CompositeDrawable
protected Bindable<T> ControlPoint { get; } = new Bindable<T>();
private const float header_height = 20;
private const float header_height = 50;
[Resolved]
protected EditorBeatmap Beatmap { get; private set; }
@ -35,7 +36,7 @@ internal abstract class Section<T> : CompositeDrawable
protected IEditorChangeHandler ChangeHandler { get; private set; }
[BackgroundDependencyLoader]
private void load(OsuColour colours)
private void load(OverlayColourProvider colours)
{
RelativeSizeAxes = Axes.X;
AutoSizeDuration = 200;
@ -46,19 +47,17 @@ private void load(OsuColour colours)
InternalChildren = new Drawable[]
{
new Box
{
Colour = colours.Gray1,
RelativeSizeAxes = Axes.Both,
},
new Container
{
RelativeSizeAxes = Axes.X,
Height = header_height,
Padding = new MarginPadding { Horizontal = 10 },
Children = new Drawable[]
{
checkbox = new OsuCheckbox
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
LabelText = typeof(T).Name.Replace(nameof(Beatmaps.ControlPoints.ControlPoint), string.Empty)
}
}
@ -72,12 +71,13 @@ private void load(OsuColour colours)
{
new Box
{
Colour = colours.Gray2,
Colour = colours.Background3,
RelativeSizeAxes = Axes.Both,
},
Flow = new FillFlowContainer
{
Padding = new MarginPadding(10),
Padding = new MarginPadding(20),
Spacing = new Vector2(20),
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Direction = FillDirection.Vertical,

View File

@ -8,15 +8,14 @@
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface;
using osu.Game.Screens.Edit.Compose.Components.Timeline;
using osu.Game.Overlays;
using osuTK;
namespace osu.Game.Screens.Edit.Timing
{
public class TimingScreen : EditorScreenWithTimeline
public class TimingScreen : RoundedContentEditorScreen
{
[Cached]
private Bindable<ControlPointGroup> selectedGroup = new Bindable<ControlPointGroup>();
@ -26,28 +25,26 @@ public TimingScreen()
{
}
protected override Drawable CreateMainContent() => new GridContainer
[BackgroundDependencyLoader]
private void load()
{
RelativeSizeAxes = Axes.Both,
ColumnDimensions = new[]
Add(new GridContainer
{
new Dimension(),
new Dimension(GridSizeMode.Absolute, 350),
},
Content = new[]
{
new Drawable[]
RelativeSizeAxes = Axes.Both,
ColumnDimensions = new[]
{
new ControlPointList(),
new ControlPointSettings(),
new Dimension(),
new Dimension(GridSizeMode.Absolute, 350),
},
}
};
protected override void OnTimelineLoaded(TimelineArea timelineArea)
{
base.OnTimelineLoaded(timelineArea);
timelineArea.Timeline.Zoom = timelineArea.Timeline.MinZoom;
Content = new[]
{
new Drawable[]
{
new ControlPointList(),
new ControlPointSettings(),
},
}
});
}
public class ControlPointList : CompositeDrawable
@ -70,7 +67,7 @@ public class ControlPointList : CompositeDrawable
private IEditorChangeHandler changeHandler { get; set; }
[BackgroundDependencyLoader]
private void load(OsuColour colours)
private void load(OverlayColourProvider colours)
{
RelativeSizeAxes = Axes.Both;
@ -78,7 +75,7 @@ private void load(OsuColour colours)
{
new Box
{
Colour = colours.Gray0,
Colour = colours.Background2,
RelativeSizeAxes = Axes.Both,
},
new OsuScrollContainer