mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 12:02:54 +08:00
Update textbox usages
This commit is contained in:
parent
97675f6495
commit
9a11a08acc
@ -16,9 +16,6 @@ namespace osu.Game.Graphics.UserInterface
|
||||
/// </summary>
|
||||
public class FocusedTextBox : OsuTextBox
|
||||
{
|
||||
protected override Color4 BackgroundUnfocused => new Color4(10, 10, 10, 255);
|
||||
protected override Color4 BackgroundFocused => new Color4(10, 10, 10, 255);
|
||||
|
||||
public Action Exit;
|
||||
|
||||
private bool focus;
|
||||
@ -47,6 +44,9 @@ namespace osu.Game.Graphics.UserInterface
|
||||
private void load(GameHost host)
|
||||
{
|
||||
this.host = host;
|
||||
|
||||
BackgroundUnfocused = new Color4(10, 10, 10, 255);
|
||||
BackgroundFocused = new Color4(10, 10, 10, 255);
|
||||
}
|
||||
|
||||
// We may not be focused yet, but we need to handle keyboard input to be able to request focus
|
||||
|
@ -16,10 +16,6 @@ namespace osu.Game.Graphics.UserInterface
|
||||
{
|
||||
public class OsuTextBox : TextBox, IKeyBindingHandler<GlobalAction>
|
||||
{
|
||||
protected override Color4 BackgroundUnfocused => Color4.Black.Opacity(0.5f);
|
||||
protected override Color4 BackgroundFocused => OsuColour.Gray(0.3f).Opacity(0.8f);
|
||||
protected override Color4 BackgroundCommit => BorderColour;
|
||||
|
||||
protected override float LeftRightPadding => 10;
|
||||
|
||||
protected override SpriteText CreatePlaceholder() => new OsuSpriteText
|
||||
@ -41,7 +37,9 @@ namespace osu.Game.Graphics.UserInterface
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colour)
|
||||
{
|
||||
BorderColour = colour.Yellow;
|
||||
BackgroundUnfocused = Color4.Black.Opacity(0.5f);
|
||||
BackgroundFocused = OsuColour.Gray(0.3f).Opacity(0.8f);
|
||||
BackgroundCommit = BorderColour = colour.Yellow;
|
||||
}
|
||||
|
||||
protected override void OnFocus(FocusEvent e)
|
||||
|
@ -190,8 +190,12 @@ namespace osu.Game.Overlays.Chat.Selection
|
||||
|
||||
private class HeaderSearchTextBox : SearchTextBox
|
||||
{
|
||||
protected override Color4 BackgroundFocused => Color4.Black.Opacity(0.2f);
|
||||
protected override Color4 BackgroundUnfocused => Color4.Black.Opacity(0.2f);
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
BackgroundFocused = Color4.Black.Opacity(0.2f);
|
||||
BackgroundUnfocused = Color4.Black.Opacity(0.2f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6,8 +6,8 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.UserInterface;
|
||||
using osuTK;
|
||||
using osuTK.Graphics;
|
||||
using System;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
|
||||
namespace osu.Game.Overlays.Music
|
||||
@ -53,15 +53,16 @@ namespace osu.Game.Overlays.Music
|
||||
|
||||
public class FilterTextBox : SearchTextBox
|
||||
{
|
||||
protected override Color4 BackgroundUnfocused => OsuColour.Gray(0.06f);
|
||||
protected override Color4 BackgroundFocused => OsuColour.Gray(0.12f);
|
||||
|
||||
protected override bool AllowCommit => true;
|
||||
|
||||
public FilterTextBox()
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
Masking = true;
|
||||
CornerRadius = 5;
|
||||
|
||||
BackgroundUnfocused = OsuColour.Gray(0.06f);
|
||||
BackgroundFocused = OsuColour.Gray(0.12f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -127,10 +127,14 @@ namespace osu.Game.Overlays.SearchableList
|
||||
|
||||
private class FilterSearchTextBox : SearchTextBox
|
||||
{
|
||||
protected override Color4 BackgroundUnfocused => OsuColour.Gray(0.06f);
|
||||
protected override Color4 BackgroundFocused => OsuColour.Gray(0.12f);
|
||||
|
||||
protected override bool AllowCommit => true;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
BackgroundUnfocused = OsuColour.Gray(0.06f);
|
||||
BackgroundFocused = OsuColour.Gray(0.12f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -316,8 +316,12 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
|
||||
private class SettingsTextBox : OsuTextBox
|
||||
{
|
||||
protected override Color4 BackgroundUnfocused => Color4.Black;
|
||||
protected override Color4 BackgroundFocused => Color4.Black;
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
BackgroundUnfocused = Color4.Black;
|
||||
BackgroundFocused = Color4.Black;
|
||||
}
|
||||
}
|
||||
|
||||
private class SettingsNumberTextBox : SettingsTextBox
|
||||
@ -327,8 +331,12 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
|
||||
private class SettingsPasswordTextBox : OsuPasswordTextBox
|
||||
{
|
||||
protected override Color4 BackgroundUnfocused => Color4.Black;
|
||||
protected override Color4 BackgroundFocused => Color4.Black;
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
BackgroundUnfocused = Color4.Black;
|
||||
BackgroundFocused = Color4.Black;
|
||||
}
|
||||
}
|
||||
|
||||
private class SectionContainer : FillFlowContainer<Section>
|
||||
|
Loading…
Reference in New Issue
Block a user