From d7919f462c32def081a8424c09731088495146d7 Mon Sep 17 00:00:00 2001 From: Ganendra Afrasya Date: Tue, 3 May 2022 05:36:12 +0700 Subject: [PATCH] Split `SearchTextBox` into `SearchTextBox` and `BasicSearchTextBox` --- .../UserInterface/BasicSearchTextBox.cs | 26 +++++++++++++++++++ .../Graphics/UserInterface/SearchTextBox.cs | 13 ---------- 2 files changed, 26 insertions(+), 13 deletions(-) create mode 100644 osu.Game/Graphics/UserInterface/BasicSearchTextBox.cs diff --git a/osu.Game/Graphics/UserInterface/BasicSearchTextBox.cs b/osu.Game/Graphics/UserInterface/BasicSearchTextBox.cs new file mode 100644 index 0000000000..aa101d7e08 --- /dev/null +++ b/osu.Game/Graphics/UserInterface/BasicSearchTextBox.cs @@ -0,0 +1,26 @@ +// Copyright (c) ppy Pty Ltd . 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 }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Graphics/UserInterface/SearchTextBox.cs b/osu.Game/Graphics/UserInterface/SearchTextBox.cs index dd9ed7c9e9..cc0bc2dc46 100644 --- a/osu.Game/Graphics/UserInterface/SearchTextBox.cs +++ b/osu.Game/Graphics/UserInterface/SearchTextBox.cs @@ -1,12 +1,9 @@ // Copyright (c) ppy Pty Ltd . 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 osu.Framework.Input; using osu.Framework.Input.Events; using osu.Game.Resources.Localisation.Web; -using osuTK; using osuTK.Input; namespace osu.Game.Graphics.UserInterface @@ -18,16 +15,6 @@ namespace osu.Game.Graphics.UserInterface public SearchTextBox() { 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; }