mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 23:24:04 +09:00
Add gradient overlay when hovering toolbar to make tooltips more visible.
Also adjusts opacity of toolbar.
This commit is contained in:
@ -12,8 +12,10 @@ using osu.Game.Configuration;
|
|||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osu.Framework.Graphics.Sprites;
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Graphics.Colour;
|
||||||
using osu.Game.Modes;
|
using osu.Game.Modes;
|
||||||
using osu.Game.Screens.Play;
|
using osu.Game.Screens.Play;
|
||||||
|
using osu.Framework.Input;
|
||||||
|
|
||||||
namespace osu.Game.Overlays
|
namespace osu.Game.Overlays
|
||||||
{
|
{
|
||||||
@ -28,6 +30,7 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
private ToolbarModeSelector modeSelector;
|
private ToolbarModeSelector modeSelector;
|
||||||
private ToolbarButton userButton;
|
private ToolbarButton userButton;
|
||||||
|
private Box gradientBackground;
|
||||||
|
|
||||||
private const int transition_time = 200;
|
private const int transition_time = 200;
|
||||||
|
|
||||||
@ -43,6 +46,18 @@ namespace osu.Game.Overlays
|
|||||||
FadeOut(transition_time, EasingTypes.InQuint);
|
FadeOut(transition_time, EasingTypes.InQuint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool OnHover(InputState state)
|
||||||
|
{
|
||||||
|
gradientBackground.FadeIn(200);
|
||||||
|
return base.OnHover(state);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnHoverLost(InputState state)
|
||||||
|
{
|
||||||
|
gradientBackground.FadeOut(200);
|
||||||
|
base.OnHoverLost(state);
|
||||||
|
}
|
||||||
|
|
||||||
public Toolbar()
|
public Toolbar()
|
||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
@ -50,7 +65,20 @@ namespace osu.Game.Overlays
|
|||||||
new Box
|
new Box
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Colour = new Color4(0.1f, 0.1f, 0.1f, 0.4f)
|
Colour = new Color4(0.1f, 0.1f, 0.1f, 0.6f)
|
||||||
|
},
|
||||||
|
gradientBackground = new Box
|
||||||
|
{
|
||||||
|
RelativeSizeAxes = Axes.X,
|
||||||
|
Anchor = Anchor.BottomLeft,
|
||||||
|
Alpha = 0,
|
||||||
|
Height = 90,
|
||||||
|
ColourInfo = new ColourInfo {
|
||||||
|
TopLeft = new Color4(0.1f, 0.1f, 0.1f, 0.5f),
|
||||||
|
TopRight = new Color4(0.1f, 0.1f, 0.1f, 0.5f),
|
||||||
|
BottomLeft = new Color4(0.1f, 0.1f, 0.1f, 0f),
|
||||||
|
BottomRight = new Color4(0.1f, 0.1f, 0.1f, 0f),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
new FlowContainer
|
new FlowContainer
|
||||||
{
|
{
|
||||||
|
@ -138,7 +138,7 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
HoverBackground.FadeTo(0.4f, 200);
|
HoverBackground.FadeTo(0.4f, 200);
|
||||||
tooltipContainer.FadeIn(100);
|
tooltipContainer.FadeIn(100);
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnHoverLost(InputState state)
|
protected override void OnHoverLost(InputState state)
|
||||||
|
Reference in New Issue
Block a user