mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 09:32:55 +08:00
Clean code and apply requested changes
This commit is contained in:
parent
0e50e4ee34
commit
3ca112aef0
@ -28,81 +28,40 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents
|
||||
|
||||
public event OnCommitHandler OnCommit;
|
||||
|
||||
private bool readOnly;
|
||||
public bool ReadOnly
|
||||
{
|
||||
get => readOnly;
|
||||
set
|
||||
{
|
||||
textBox.ReadOnly = value;
|
||||
readOnly = value;
|
||||
}
|
||||
get => textBox.ReadOnly;
|
||||
set => textBox.ReadOnly = value;
|
||||
}
|
||||
|
||||
private string labelText;
|
||||
public string LabelText
|
||||
{
|
||||
get => labelText;
|
||||
set
|
||||
{
|
||||
labelText = value;
|
||||
label.Text = value;
|
||||
}
|
||||
get => label.Text;
|
||||
set => label.Text = value;
|
||||
}
|
||||
|
||||
private float labelTextSize;
|
||||
public float LabelTextSize
|
||||
{
|
||||
get => labelTextSize;
|
||||
set
|
||||
{
|
||||
labelTextSize = value;
|
||||
label.TextSize = value;
|
||||
}
|
||||
get => label.TextSize;
|
||||
set => label.TextSize = value;
|
||||
}
|
||||
|
||||
private string placeholderText;
|
||||
public string PlaceholderText
|
||||
{
|
||||
get => placeholderText;
|
||||
set
|
||||
{
|
||||
placeholderText = value;
|
||||
textBox.PlaceholderText = value;
|
||||
}
|
||||
get => textBox.PlaceholderText;
|
||||
set => textBox.PlaceholderText = value;
|
||||
}
|
||||
|
||||
private string text;
|
||||
public string Text
|
||||
{
|
||||
get => text;
|
||||
set
|
||||
{
|
||||
text = value;
|
||||
textBox.Text = value;
|
||||
}
|
||||
}
|
||||
|
||||
private float height = default_height;
|
||||
public float Height
|
||||
{
|
||||
get => height;
|
||||
private set
|
||||
{
|
||||
height = value;
|
||||
textBox.Height = value;
|
||||
content.Height = value;
|
||||
}
|
||||
get => textBox.Text;
|
||||
set => textBox.Text = value;
|
||||
}
|
||||
|
||||
public MarginPadding Padding
|
||||
{
|
||||
get => base.Padding;
|
||||
set
|
||||
{
|
||||
base.Padding = value;
|
||||
base.Height = Height + base.Padding.Top;
|
||||
}
|
||||
set => base.Padding = value;
|
||||
}
|
||||
|
||||
public MarginPadding LabelPadding
|
||||
@ -132,7 +91,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents
|
||||
public LabelledTextBox()
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
base.Height = default_height + Padding.Top;
|
||||
Height = default_height;
|
||||
CornerRadius = outer_corner_radius;
|
||||
Masking = true;
|
||||
|
||||
@ -148,11 +107,7 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Colour = OsuColour.FromHex("1c2125"),
|
||||
},
|
||||
new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = default_height,
|
||||
Child = new GridContainer
|
||||
new GridContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = default_height,
|
||||
@ -173,8 +128,8 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents
|
||||
{
|
||||
Anchor = Anchor.TopLeft,
|
||||
Origin = Anchor.TopLeft,
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = default_height,
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Height = 1,
|
||||
CornerRadius = inner_corner_radius,
|
||||
},
|
||||
},
|
||||
@ -186,7 +141,6 @@ namespace osu.Game.Screens.Edit.Screens.Setup.Components.LabelledComponents
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
textBox.OnCommit += OnCommit;
|
||||
|
Loading…
Reference in New Issue
Block a user