Add tooltip to sliderbars. Move interface.

This commit is contained in:
Dean Herbert
2017-04-20 17:33:07 +09:00
parent ce5763ed97
commit c87657707f
4 changed files with 8 additions and 10 deletions

View File

@ -3,7 +3,7 @@
using osu.Framework.Graphics;
namespace osu.Game.Graphics.Cursor
namespace osu.Game.Graphics
{
public interface IHasTooltip : IDrawable
{

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using OpenTK;
using osu.Framework.Allocation;
using osu.Framework.Audio;
@ -12,7 +13,7 @@ using osu.Framework.Input;
namespace osu.Game.Graphics.UserInterface
{
public class OsuSliderBar<U> : SliderBar<U> where U : struct
public class OsuSliderBar<U> : SliderBar<U>, IHasTooltip where U : struct
{
private SampleChannel sample;
private double lastSampleTime;
@ -21,6 +22,8 @@ namespace osu.Game.Graphics.UserInterface
private readonly Box leftBox;
private readonly Box rightBox;
public string TooltipText => Current.Value.ToString();
public OsuSliderBar()
{
Height = 12;