1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 20:53:00 +08:00

Only pad textbox after collection is created

This commit is contained in:
smoogipoo 2020-09-08 17:05:31 +09:00
parent 38ade433a6
commit 2e40ff25f7

View File

@ -60,6 +60,7 @@ namespace osu.Game.Collections
[Resolved] [Resolved]
private BeatmapCollectionManager collectionManager { get; set; } private BeatmapCollectionManager collectionManager { get; set; }
private Container textBoxPaddingContainer;
private ItemTextBox textBox; private ItemTextBox textBox;
public ItemContent(BeatmapCollection collection) public ItemContent(BeatmapCollection collection)
@ -85,7 +86,7 @@ namespace osu.Game.Collections
IsCreated = { BindTarget = IsCreated }, IsCreated = { BindTarget = IsCreated },
IsTextBoxHovered = v => textBox.ReceivePositionalInputAt(v) IsTextBoxHovered = v => textBox.ReceivePositionalInputAt(v)
}, },
new Container textBoxPaddingContainer = new Container
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Right = button_width }, Padding = new MarginPadding { Right = button_width },
@ -107,7 +108,9 @@ namespace osu.Game.Collections
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
collectionName.BindValueChanged(_ => createNewCollection(), true); collectionName.BindValueChanged(_ => createNewCollection(), true);
IsCreated.BindValueChanged(created => textBoxPaddingContainer.Padding = new MarginPadding { Right = created.NewValue ? button_width : 0 }, true);
} }
private void createNewCollection() private void createNewCollection()