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

Merge pull request #32135 from zihadmahiuddin/fix/settings-show-at-visibility

Fix settings control not visible because of previous search
This commit is contained in:
Bartłomiej Dach 2025-03-03 13:29:26 +01:00 committed by GitHub
commit a33e76717c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 8 deletions

View File

@ -68,6 +68,9 @@ namespace osu.Game.Overlays
public void ShowAtControl<T>()
where T : Drawable
{
// if search isn't cleared then the target control won't be visible if it doesn't match the query
SearchTextBox.Current.SetDefault();
Show();
// wait for load of sections

View File

@ -54,7 +54,7 @@ namespace osu.Game.Overlays
public SettingsSectionsContainer SectionsContainer { get; private set; }
private SeekLimitedSearchTextBox searchTextBox;
protected SeekLimitedSearchTextBox SearchTextBox { get; private set; }
protected override string PopInSampleName => "UI/settings-pop-in";
protected override double PopInOutSampleBalance => -OsuGameBase.SFX_STEREO_STRENGTH;
@ -135,7 +135,7 @@ namespace osu.Game.Overlays
},
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
Child = searchTextBox = new SettingsSearchTextBox
Child = SearchTextBox = new SettingsSearchTextBox
{
RelativeSizeAxes = Axes.X,
Origin = Anchor.TopCentre,
@ -183,8 +183,8 @@ namespace osu.Game.Overlays
Sidebar?.MoveToX(0, TRANSITION_LENGTH, Easing.OutQuint);
this.FadeTo(1, TRANSITION_LENGTH / 2, Easing.OutQuint);
searchTextBox.TakeFocus();
searchTextBox.HoldFocus = true;
SearchTextBox.TakeFocus();
SearchTextBox.HoldFocus = true;
}
protected virtual float ExpandedPosition => 0;
@ -199,8 +199,8 @@ namespace osu.Game.Overlays
Sidebar?.MoveToX(-sidebar_width, TRANSITION_LENGTH, Easing.OutQuint);
this.FadeTo(0, TRANSITION_LENGTH / 2, Easing.OutQuint);
searchTextBox.HoldFocus = false;
if (searchTextBox.HasFocus)
SearchTextBox.HoldFocus = false;
if (SearchTextBox.HasFocus)
GetContainingFocusManager()!.ChangeFocus(null);
}
@ -208,7 +208,7 @@ namespace osu.Game.Overlays
protected override void OnFocus(FocusEvent e)
{
searchTextBox.TakeFocus();
SearchTextBox.TakeFocus();
base.OnFocus(e);
}
@ -234,7 +234,7 @@ namespace osu.Game.Overlays
loading.Hide();
searchTextBox.Current.BindValueChanged(term => SectionsContainer.SearchTerm = term.NewValue, true);
SearchTextBox.Current.BindValueChanged(term => SectionsContainer.SearchTerm = term.NewValue, true);
loadSidebarButtons();
});