mirror of
https://github.com/ppy/osu.git
synced 2024-12-16 00:02:54 +08:00
Remove magic numbers
This commit is contained in:
parent
9b863f60ab
commit
8e09b738b0
@ -60,7 +60,7 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
AutoSizeAxes = Axes.Y,
|
AutoSizeAxes = Axes.Y,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
chevron = new TextAwesome
|
Chevron = new TextAwesome
|
||||||
{
|
{
|
||||||
AlwaysPresent = true,
|
AlwaysPresent = true,
|
||||||
Icon = FontAwesome.fa_chevron_right,
|
Icon = FontAwesome.fa_chevron_right,
|
||||||
@ -84,12 +84,12 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
|
|
||||||
private Color4? accentColour;
|
private Color4? accentColour;
|
||||||
|
|
||||||
private readonly TextAwesome chevron;
|
protected readonly TextAwesome Chevron;
|
||||||
|
|
||||||
protected override void FormatForeground(bool hover = false)
|
protected override void FormatForeground(bool hover = false)
|
||||||
{
|
{
|
||||||
base.FormatForeground(hover);
|
base.FormatForeground(hover);
|
||||||
chevron.Alpha = hover ? 1 : 0;
|
Chevron.Alpha = hover ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Color4 AccentColour
|
public Color4 AccentColour
|
||||||
|
@ -268,6 +268,8 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
|||||||
|
|
||||||
private class UserDropdownHeader : OsuDropdownHeader
|
private class UserDropdownHeader : OsuDropdownHeader
|
||||||
{
|
{
|
||||||
|
public static readonly float LABEL_LEFT_MARGIN = 20;
|
||||||
|
|
||||||
protected readonly TextAwesome statusIcon;
|
protected readonly TextAwesome statusIcon;
|
||||||
|
|
||||||
public Color4 StatusColour
|
public Color4 StatusColour
|
||||||
@ -302,8 +304,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
|||||||
TextSize = 14,
|
TextSize = 14,
|
||||||
});
|
});
|
||||||
|
|
||||||
//todo: Magic number
|
Text.Margin = new MarginPadding { Left = LABEL_LEFT_MARGIN };
|
||||||
Text.Margin = new MarginPadding { Left = 20 };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -340,8 +341,8 @@ namespace osu.Game.Overlays.Settings.Sections.General
|
|||||||
{
|
{
|
||||||
public UserDropdownMenuItem(string text, UserAction current) : base(text, current)
|
public UserDropdownMenuItem(string text, UserAction current) : base(text, current)
|
||||||
{
|
{
|
||||||
//todo: Another magic number
|
Foreground.Padding = new MarginPadding { Top = 5, Bottom = 5, Left = UserDropdownHeader.LABEL_LEFT_MARGIN, Right = 5 };
|
||||||
Foreground.Padding = new MarginPadding { Top = 5, Bottom = 5, Left = 19, Right = 5 };
|
Chevron.Margin = new MarginPadding { Left = 2, Right = 3 };
|
||||||
CornerRadius = 5;
|
CornerRadius = 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user