1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-25 23:52:54 +08:00

Only expose bindable string rather than full textbox

This commit is contained in:
Dean Herbert 2022-07-15 18:01:35 +09:00
parent 86d019c2b2
commit e12e480393
2 changed files with 13 additions and 11 deletions

View File

@ -180,7 +180,7 @@ namespace osu.Game.Screens.Select
void searchOnSongSelect(string text)
{
if (songSelect != null)
songSelect.FilterControl.SearchTextBox.Text = text;
songSelect.FilterControl.CurrentTextSearch.Value = text;
}
}

View File

@ -31,6 +31,8 @@ namespace osu.Game.Screens.Select
public Action<FilterCriteria> FilterChanged;
public Bindable<string> CurrentTextSearch => searchTextBox.Current;
private OsuTabControl<SortMode> sortTabs;
private Bindable<SortMode> sortMode;
@ -39,7 +41,7 @@ namespace osu.Game.Screens.Select
public FilterCriteria CreateCriteria()
{
string query = SearchTextBox.Text;
string query = searchTextBox.Text;
var criteria = new FilterCriteria
{
@ -62,7 +64,7 @@ namespace osu.Game.Screens.Select
return criteria;
}
public SeekLimitedSearchTextBox SearchTextBox { get; private set; }
private SeekLimitedSearchTextBox searchTextBox;
private CollectionFilterDropdown collectionDropdown;
@ -104,7 +106,7 @@ namespace osu.Game.Screens.Select
Height = 60,
Children = new Drawable[]
{
SearchTextBox = new SeekLimitedSearchTextBox { RelativeSizeAxes = Axes.X },
searchTextBox = new SeekLimitedSearchTextBox { RelativeSizeAxes = Axes.X },
new Box
{
RelativeSizeAxes = Axes.X,
@ -205,23 +207,23 @@ namespace osu.Game.Screens.Select
updateCriteria();
};
SearchTextBox.Current.ValueChanged += _ => updateCriteria();
searchTextBox.Current.ValueChanged += _ => updateCriteria();
updateCriteria();
}
public void Deactivate()
{
SearchTextBox.ReadOnly = true;
SearchTextBox.HoldFocus = false;
if (SearchTextBox.HasFocus)
GetContainingInputManager().ChangeFocus(SearchTextBox);
searchTextBox.ReadOnly = true;
searchTextBox.HoldFocus = false;
if (searchTextBox.HasFocus)
GetContainingInputManager().ChangeFocus(searchTextBox);
}
public void Activate()
{
SearchTextBox.ReadOnly = false;
SearchTextBox.HoldFocus = true;
searchTextBox.ReadOnly = false;
searchTextBox.HoldFocus = true;
}
private readonly IBindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();