1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 11:27:24 +08:00

Split SearchTextBox into SearchTextBox and BasicSearchTextBox

This commit is contained in:
Ganendra Afrasya 2022-05-03 05:36:12 +07:00
parent 4442ed89b5
commit d7919f462c
2 changed files with 26 additions and 13 deletions

View File

@ -0,0 +1,26 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osuTK;
namespace osu.Game.Graphics.UserInterface
{
public class BasicSearchTextBox : SearchTextBox
{
public BasicSearchTextBox()
{
Add(new SpriteIcon
{
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 };
}
}
}

View File

@ -1,12 +1,9 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Input; using osu.Framework.Input;
using osu.Framework.Input.Events; using osu.Framework.Input.Events;
using osu.Game.Resources.Localisation.Web; using osu.Game.Resources.Localisation.Web;
using osuTK;
using osuTK.Input; using osuTK.Input;
namespace osu.Game.Graphics.UserInterface namespace osu.Game.Graphics.UserInterface
@ -18,16 +15,6 @@ namespace osu.Game.Graphics.UserInterface
public SearchTextBox() public SearchTextBox()
{ {
Height = 35; Height = 35;
Add(new SpriteIcon
{
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 = HomeStrings.SearchPlaceholder; PlaceholderText = HomeStrings.SearchPlaceholder;
} }