Small textbox adjustments

This commit is contained in:
Andrei Zavatski 2020-02-18 17:40:12 +03:00
parent 7228900361
commit b6423dd92e
2 changed files with 21 additions and 12 deletions

View File

@ -17,18 +17,16 @@ namespace osu.Game.Graphics.UserInterface
public SearchTextBox() public SearchTextBox()
{ {
Height = 35; Height = 35;
AddRange(new Drawable[] Add(new SpriteIcon
{ {
new SpriteIcon Icon = FontAwesome.Solid.Search,
{ Origin = Anchor.CentreRight,
Icon = FontAwesome.Solid.Search, Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight, Margin = new MarginPadding { Right = 10 },
Anchor = Anchor.CentreRight, Size = new Vector2(20),
Margin = new MarginPadding { Right = 10 },
Size = new Vector2(20),
}
}); });
TextFlow.Padding = new MarginPadding { Right = 35 };
PlaceholderText = "type to search"; PlaceholderText = "type to search";
} }

View File

@ -13,6 +13,7 @@ using osu.Game.Beatmaps.Drawables;
using osu.Game.Beatmaps; using osu.Game.Beatmaps;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osuTK.Graphics;
namespace osu.Game.Overlays.BeatmapListing namespace osu.Game.Overlays.BeatmapListing
{ {
@ -28,7 +29,7 @@ namespace osu.Game.Overlays.BeatmapListing
{ {
set set
{ {
if (value == null) if (value == null || string.IsNullOrEmpty(value.OnlineInfo.Covers.Cover))
{ {
beatmapCover.FadeOut(600, Easing.OutQuint); beatmapCover.FadeOut(600, Easing.OutQuint);
return; return;
@ -39,7 +40,7 @@ namespace osu.Game.Overlays.BeatmapListing
} }
} }
private readonly SearchTextBox textBox; private readonly BeatmapSearchTextBox textBox;
private readonly BeatmapSearchRulesetFilterRow modeFilter; private readonly BeatmapSearchRulesetFilterRow modeFilter;
private readonly BeatmapSearchFilterRow<BeatmapSearchCategory> categoryFilter; private readonly BeatmapSearchFilterRow<BeatmapSearchCategory> categoryFilter;
@ -83,7 +84,7 @@ namespace osu.Game.Overlays.BeatmapListing
Spacing = new Vector2(0, 20), Spacing = new Vector2(0, 20),
Children = new Drawable[] Children = new Drawable[]
{ {
textBox = new SearchTextBox textBox = new BeatmapSearchTextBox
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
}, },
@ -110,5 +111,15 @@ namespace osu.Game.Overlays.BeatmapListing
{ {
background.Colour = colourProvider.Dark6; background.Colour = colourProvider.Dark6;
} }
private class BeatmapSearchTextBox : SearchTextBox
{
protected override Color4 SelectionColour => Color4.Gray;
public BeatmapSearchTextBox()
{
PlaceholderText = @"type in keywords...";
}
}
} }
} }