1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-05 11:43:01 +08:00

Update design of timeline centre marker and adjust surrounding paddings

This commit is contained in:
Dean Herbert 2023-07-14 15:58:53 +09:00
parent 00e9746174
commit 57abb15724
3 changed files with 23 additions and 21 deletions

View File

@ -12,17 +12,17 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
public partial class CentreMarker : CompositeDrawable
{
private const float triangle_width = 15;
private const float triangle_height = 10;
private const float bar_width = 2;
private const float triangle_width = 8;
private const float bar_width = 1.6f;
public CentreMarker()
{
RelativeSizeAxes = Axes.Y;
Size = new Vector2(triangle_width, 1);
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
Anchor = Anchor.TopCentre;
Origin = Anchor.TopCentre;
InternalChildren = new Drawable[]
{
@ -37,22 +37,16 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
Anchor = Anchor.TopCentre,
Origin = Anchor.BottomCentre,
Size = new Vector2(triangle_width, triangle_height),
Size = new Vector2(triangle_width, triangle_width * 0.8f),
Scale = new Vector2(1, -1)
},
new Triangle
{
Anchor = Anchor.BottomCentre,
Origin = Anchor.BottomCentre,
Size = new Vector2(triangle_width, triangle_height),
}
};
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
Colour = colours.RedDark;
Colour = colours.Red1;
}
}
}

View File

@ -6,6 +6,7 @@ using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Graphics.Sprites;
using osu.Game.Graphics;
using osu.Game.Graphics.UserInterface;
using osu.Game.Localisation;
using osu.Game.Overlays;
@ -29,10 +30,8 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
}
[BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider)
private void load(OverlayColourProvider colourProvider, OsuColour colours)
{
Masking = true;
OsuCheckbox waveformCheckbox;
OsuCheckbox controlPointsCheckbox;
OsuCheckbox ticksCheckbox;
@ -51,7 +50,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
new Dimension(GridSizeMode.Absolute, 140),
new Dimension(),
new Dimension(GridSizeMode.Absolute, 30),
new Dimension(GridSizeMode.Absolute, 35),
new Dimension(GridSizeMode.Absolute, 110),
},
Content = new[]
@ -102,6 +101,16 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
AutoSizeAxes = Axes.Y,
Children = new Drawable[]
{
// the out-of-bounds portion of the centre marker.
new Box
{
Width = 24,
Height = EditorScreenWithTimeline.PADDING,
Depth = float.MaxValue,
Colour = colours.Red1,
Anchor = Anchor.TopCentre,
Origin = Anchor.BottomCentre,
},
new Box
{
RelativeSizeAxes = Axes.Both,
@ -115,7 +124,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
{
RelativeSizeAxes = Axes.Both,
Name = @"Zoom controls",
Padding = new MarginPadding { Right = 5 },
Padding = new MarginPadding { Right = 10 },
Children = new Drawable[]
{
new Box
@ -128,7 +137,6 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
RelativeSizeAxes = Axes.Both,
Masking = true,
Children = new[]
{
new TimelineButton

View File

@ -13,7 +13,7 @@ namespace osu.Game.Screens.Edit
{
public abstract partial class EditorScreenWithTimeline : EditorScreen
{
private const float padding = 15;
public const float PADDING = 10;
private Container timelineContainer = null!;
@ -61,7 +61,7 @@ namespace osu.Game.Screens.Edit
Name = "Timeline content",
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = padding, Top = padding },
Padding = new MarginPadding { Horizontal = PADDING, Top = PADDING },
Child = new GridContainer
{
RelativeSizeAxes = Axes.X,