mirror of
https://github.com/jwetzell/qController.git
synced 2026-09-10 08:39:40 +00:00
36 lines
880 B
C#
36 lines
880 B
C#
using Microsoft.Maui.Graphics;
|
|
namespace qController
|
|
{
|
|
public class QButton : Button
|
|
{
|
|
public QCommand qCommand
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public QButton(QCommand command)
|
|
{
|
|
|
|
qCommand = command;
|
|
Text = qCommand.text;
|
|
TextColor = Colors.Black;
|
|
FontSize = App.WidthUnit * 5;
|
|
if (qCommand.osc.Contains("go"))
|
|
{
|
|
BackgroundColor = Colors.SeaGreen;
|
|
FontSize = App.HeightUnit * 4;
|
|
FontAttributes = FontAttributes.Bold;
|
|
}
|
|
else if (qCommand.osc.Contains("panic"))
|
|
{
|
|
BackgroundColor = Colors.IndianRed;
|
|
}
|
|
else
|
|
{
|
|
BackgroundColor = Color.FromArgb("D8D8D8");
|
|
}
|
|
}
|
|
}
|
|
}
|