mirror of
https://github.com/ppy/osu.git
synced 2025-02-01 04:12:55 +08:00
Immediately focus the textbox when clicking to reply to a comment
This commit is contained in:
parent
81e6c3792c
commit
4916a742d5
osu.Game/Overlays/Comments
@ -35,6 +35,8 @@ namespace osu.Game.Overlays.Comments
|
|||||||
private RoundedButton commitButton = null!;
|
private RoundedButton commitButton = null!;
|
||||||
private LoadingSpinner loadingSpinner = null!;
|
private LoadingSpinner loadingSpinner = null!;
|
||||||
|
|
||||||
|
protected TextBox TextBox { get; private set; } = null!;
|
||||||
|
|
||||||
protected bool ShowLoadingSpinner
|
protected bool ShowLoadingSpinner
|
||||||
{
|
{
|
||||||
set
|
set
|
||||||
@ -51,8 +53,6 @@ namespace osu.Game.Overlays.Comments
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OverlayColourProvider colourProvider)
|
private void load(OverlayColourProvider colourProvider)
|
||||||
{
|
{
|
||||||
EditorTextBox textBox;
|
|
||||||
|
|
||||||
RelativeSizeAxes = Axes.X;
|
RelativeSizeAxes = Axes.X;
|
||||||
AutoSizeAxes = Axes.Y;
|
AutoSizeAxes = Axes.Y;
|
||||||
Masking = true;
|
Masking = true;
|
||||||
@ -74,7 +74,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
Direction = FillDirection.Vertical,
|
Direction = FillDirection.Vertical,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
textBox = new EditorTextBox
|
TextBox = new EditorTextBox
|
||||||
{
|
{
|
||||||
Height = 40,
|
Height = 40,
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
@ -133,7 +133,7 @@ namespace osu.Game.Overlays.Comments
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
textBox.OnCommit += (_, _) => commitButton.TriggerClick();
|
TextBox.OnCommit += (_, _) => commitButton.TriggerClick();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
|
@ -36,6 +36,13 @@ namespace osu.Game.Overlays.Comments
|
|||||||
OnCancel = () => this.FadeOut(200).Expire();
|
OnCancel = () => this.FadeOut(200).Expire();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
GetContainingInputManager().ChangeFocus(TextBox);
|
||||||
|
}
|
||||||
|
|
||||||
protected override void OnCommit(string text)
|
protected override void OnCommit(string text)
|
||||||
{
|
{
|
||||||
ShowLoadingSpinner = true;
|
ShowLoadingSpinner = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user