Luski/Luski/GUI/MainScreen/UI/SettingsPanel/ThemeDropButton.cs
2024-11-17 22:58:21 -05:00

53 lines
1.6 KiB
C#

using GraphicsManager.Enums;
using GraphicsManager.Interfaces;
using GraphicsManager.Objects;
using GraphicsManager.Objects.Core;
using Luski.Classes;
using Luski.GUI.MainScreen.UI.LuskiControls;
using OpenTK.Mathematics;
namespace Luski.GUI.MainScreen.UI.SettingsPanel;
public class ThemeDropButton : DropDownOption
{
private Label l, d;
public ThemeStart ESI;
public ThemeDropButton(ThemeStart esi)
:base(Globals.ms.TextureManager.GetTextureResource("RoundedRectangle.png"))
{
ESI = esi;
base.Size = new(297.ScaleInt(), 40.ScaleInt());
TextureDisplay = TextureDisplay.HorizontalCenter;
Shader = Rectangle.DefaultAlphaShader[Globals.ms.Context];
l = new Label(Globals.DefaultFont)
{
Text = esi.Name,
Color = Color4.DarkGray,
IgnoreHover = true
};
l.Location = new(10.ScaleInt(),
((base.Size.Y - l.Size.Y) / 2));
d = new(Globals.MessageFont)
{
Text = esi.Description,
Color = Color4.Gray,
IgnoreHover = true
};
d.Location = new(l.Location.X + l.Size.X + l.Location.X,
l.Location.Y + (int)l.Font.PixelHeight - (int)d.Font.PixelHeight);
Controls.Add(d);
Controls.Add(l);
BackgroundColor = new(0, 0, 0, 0);
MouseEnter += o =>
{
BackgroundColor = new(141, 151, 165, 30);
return Task.CompletedTask;
};
MouseLeave += o =>
{
BackgroundColor = new(0,0,0,0);
return Task.CompletedTask;
};
}
}