(ded4a3e0a) v0.9.0.7
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
using System;
|
||||
using Eto.Drawing;
|
||||
|
||||
namespace MonoGame.Tools.Pipeline
|
||||
{
|
||||
static class DrawInfo
|
||||
{
|
||||
private static bool once;
|
||||
|
||||
public static int TextHeight;
|
||||
public static Color TextColor, BackColor, HoverTextColor, HoverBackColor, DisabledTextColor, BorderColor;
|
||||
|
||||
static DrawInfo()
|
||||
{
|
||||
TextHeight = (int)SystemFonts.Default().LineHeight;
|
||||
TextColor = SystemColors.ControlText;
|
||||
BackColor = SystemColors.ControlBackground;
|
||||
HoverTextColor = SystemColors.HighlightText;
|
||||
HoverBackColor = SystemColors.Highlight;
|
||||
DisabledTextColor = SystemColors.ControlText;
|
||||
DisabledTextColor.A = 0.4f;
|
||||
BorderColor = Global.Unix ? SystemColors.WindowBackground : SystemColors.Control;
|
||||
}
|
||||
|
||||
public static void SetPixelsPerPoint(Graphics g)
|
||||
{
|
||||
if (!once && !Global.Unix)
|
||||
{
|
||||
once = true;
|
||||
TextHeight = (int)(SystemFonts.Default().LineHeight * g.PixelsPerPoint + 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
public static Color GetTextColor(bool selected, bool disabled)
|
||||
{
|
||||
if (disabled)
|
||||
return DisabledTextColor;
|
||||
|
||||
return selected ? HoverTextColor : TextColor;
|
||||
}
|
||||
|
||||
public static Color GetBackgroundColor(bool selected)
|
||||
{
|
||||
return selected ? HoverBackColor : BackColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user