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

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()
{
Height = 35;
AddRange(new Drawable[]
Add(new SpriteIcon
{
new SpriteIcon
{
Icon = FontAwesome.Solid.Search,
Origin = Anchor.CentreRight,
Anchor = Anchor.CentreRight,
Margin = new MarginPadding { Right = 10 },
Size = new Vector2(20),
}
Icon = FontAwesome.Solid.Search,
Origin = Anchor.CentreRight,
Anchor = Anchor.CentreRight,
Margin = new MarginPadding { Right = 10 },
Size = new Vector2(20),
});
TextFlow.Padding = new MarginPadding { Right = 35 };
PlaceholderText = "type to search";
}

View File

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