mirror of
https://github.com/ppy/osu.git
synced 2024-11-07 13:47:33 +08:00
Move matches string inside text box
This commit is contained in:
parent
89b42ddd98
commit
cd102da3af
@ -38,8 +38,8 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
public LocalisableString InformationalText
|
||||
{
|
||||
get => filterText.Text;
|
||||
set => filterText.Text = value;
|
||||
get => searchTextBox.FilterText.Text;
|
||||
set => searchTextBox.FilterText.Text = value;
|
||||
}
|
||||
|
||||
private OsuTabControl<SortMode> sortTabs;
|
||||
@ -48,12 +48,10 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private Bindable<GroupMode> groupMode;
|
||||
|
||||
private SeekLimitedSearchTextBox searchTextBox;
|
||||
private FilterControlTextBox searchTextBox;
|
||||
|
||||
private CollectionDropdown collectionDropdown;
|
||||
|
||||
private OsuSpriteText filterText;
|
||||
|
||||
public FilterCriteria CreateCriteria()
|
||||
{
|
||||
string query = searchTextBox.Text;
|
||||
@ -111,22 +109,9 @@ namespace osu.Game.Screens.Select
|
||||
Spacing = new Vector2(0, 5),
|
||||
Children = new Drawable[]
|
||||
{
|
||||
searchTextBox = new SeekLimitedSearchTextBox { RelativeSizeAxes = Axes.X },
|
||||
new Container
|
||||
searchTextBox = new FilterControlTextBox
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
AutoSizeAxes = Axes.Y,
|
||||
AutoSizeDuration = 200,
|
||||
AutoSizeEasing = Easing.OutQuint,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
filterText = new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
Font = OsuFont.Default.With(size: 12),
|
||||
},
|
||||
}
|
||||
},
|
||||
new Box
|
||||
{
|
||||
@ -262,5 +247,32 @@ namespace osu.Game.Screens.Select
|
||||
protected override bool OnClick(ClickEvent e) => true;
|
||||
|
||||
protected override bool OnHover(HoverEvent e) => true;
|
||||
|
||||
private partial class FilterControlTextBox : SeekLimitedSearchTextBox
|
||||
{
|
||||
private const float filter_text_size = 12;
|
||||
|
||||
public OsuSpriteText FilterText;
|
||||
|
||||
public FilterControlTextBox()
|
||||
{
|
||||
Height += filter_text_size;
|
||||
TextContainer.Margin = new MarginPadding { Bottom = filter_text_size };
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
TextContainer.Add(FilterText = new OsuSpriteText
|
||||
{
|
||||
Anchor = Anchor.BottomLeft,
|
||||
Origin = Anchor.TopLeft,
|
||||
Depth = float.MinValue,
|
||||
Font = OsuFont.Default.With(size: filter_text_size, weight: FontWeight.SemiBold),
|
||||
Margin = new MarginPadding { Top = 2, Left = 2 },
|
||||
Colour = colours.Yellow
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -168,8 +168,8 @@ namespace osu.Game.Screens.Select
|
||||
Carousel.CountDisplayed == 1
|
||||
// Intentionally not localised until we have proper support for this (see https://github.com/ppy/osu-framework/pull/4918
|
||||
// but also in this case we want support for formatting a number within a string).
|
||||
? $"{Carousel.CountDisplayed:#,0} beatmap displayed"
|
||||
: $"{Carousel.CountDisplayed:#,0} beatmaps displayed";
|
||||
? $"{Carousel.CountDisplayed:#,0} matching beatmap"
|
||||
: $"{Carousel.CountDisplayed:#,0} matching beatmaps";
|
||||
},
|
||||
GetRecommendedBeatmap = s => recommender?.GetRecommendedBeatmap(s),
|
||||
}, c => carouselContainer.Child = c);
|
||||
|
Loading…
Reference in New Issue
Block a user