mirror of
https://github.com/ppy/osu.git
synced 2025-02-26 02:53:21 +08:00
Only expose bindable string rather than full textbox
This commit is contained in:
parent
86d019c2b2
commit
e12e480393
@ -180,7 +180,7 @@ namespace osu.Game.Screens.Select
|
|||||||
void searchOnSongSelect(string text)
|
void searchOnSongSelect(string text)
|
||||||
{
|
{
|
||||||
if (songSelect != null)
|
if (songSelect != null)
|
||||||
songSelect.FilterControl.SearchTextBox.Text = text;
|
songSelect.FilterControl.CurrentTextSearch.Value = text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,8 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
public Action<FilterCriteria> FilterChanged;
|
public Action<FilterCriteria> FilterChanged;
|
||||||
|
|
||||||
|
public Bindable<string> CurrentTextSearch => searchTextBox.Current;
|
||||||
|
|
||||||
private OsuTabControl<SortMode> sortTabs;
|
private OsuTabControl<SortMode> sortTabs;
|
||||||
|
|
||||||
private Bindable<SortMode> sortMode;
|
private Bindable<SortMode> sortMode;
|
||||||
@ -39,7 +41,7 @@ namespace osu.Game.Screens.Select
|
|||||||
|
|
||||||
public FilterCriteria CreateCriteria()
|
public FilterCriteria CreateCriteria()
|
||||||
{
|
{
|
||||||
string query = SearchTextBox.Text;
|
string query = searchTextBox.Text;
|
||||||
|
|
||||||
var criteria = new FilterCriteria
|
var criteria = new FilterCriteria
|
||||||
{
|
{
|
||||||
@ -62,7 +64,7 @@ namespace osu.Game.Screens.Select
|
|||||||
return criteria;
|
return criteria;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SeekLimitedSearchTextBox SearchTextBox { get; private set; }
|
private SeekLimitedSearchTextBox searchTextBox;
|
||||||
|
|
||||||
private CollectionFilterDropdown collectionDropdown;
|
private CollectionFilterDropdown collectionDropdown;
|
||||||
|
|
||||||
@ -104,7 +106,7 @@ namespace osu.Game.Screens.Select
|
|||||||
Height = 60,
|
Height = 60,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
SearchTextBox = new SeekLimitedSearchTextBox { RelativeSizeAxes = Axes.X },
|
searchTextBox = new SeekLimitedSearchTextBox { RelativeSizeAxes = Axes.X },
|
||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
@ -205,23 +207,23 @@ namespace osu.Game.Screens.Select
|
|||||||
updateCriteria();
|
updateCriteria();
|
||||||
};
|
};
|
||||||
|
|
||||||
SearchTextBox.Current.ValueChanged += _ => updateCriteria();
|
searchTextBox.Current.ValueChanged += _ => updateCriteria();
|
||||||
|
|
||||||
updateCriteria();
|
updateCriteria();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Deactivate()
|
public void Deactivate()
|
||||||
{
|
{
|
||||||
SearchTextBox.ReadOnly = true;
|
searchTextBox.ReadOnly = true;
|
||||||
SearchTextBox.HoldFocus = false;
|
searchTextBox.HoldFocus = false;
|
||||||
if (SearchTextBox.HasFocus)
|
if (searchTextBox.HasFocus)
|
||||||
GetContainingInputManager().ChangeFocus(SearchTextBox);
|
GetContainingInputManager().ChangeFocus(searchTextBox);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Activate()
|
public void Activate()
|
||||||
{
|
{
|
||||||
SearchTextBox.ReadOnly = false;
|
searchTextBox.ReadOnly = false;
|
||||||
SearchTextBox.HoldFocus = true;
|
searchTextBox.HoldFocus = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly IBindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
private readonly IBindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
||||||
|
Loading…
Reference in New Issue
Block a user