Details ausgearbeitet
Linked colors to options menu Options extension Aussehen aufgebohrt: - erlaubt text von status zu ändern, - bessere beschriftung von Farben desing änderung und bedienung - heute status felder anklickbar, - Farbpalette verdunkelt und kontrast reduziert - Kalender Tage anklickbar gemacht - Optionen überarbeitet
This commit is contained in:
@@ -1,27 +1,41 @@
|
||||
namespace cfs_tracker.Models;
|
||||
using cfs_tracker.Helpers;
|
||||
|
||||
namespace cfs_tracker.Models;
|
||||
|
||||
public static class HealthStateExtensions
|
||||
{
|
||||
public static Color ToColor(this HealthState state)
|
||||
public static string ToColorKey(this HealthState state)
|
||||
{
|
||||
return state switch
|
||||
{
|
||||
HealthState.Green => Color.FromArgb("#4CAF50"),
|
||||
HealthState.Yellow => Color.FromArgb("#FBC02D"),
|
||||
HealthState.Red => Color.FromArgb("#E53935"),
|
||||
HealthState.Gray => Color.FromArgb("#757575"),
|
||||
_ => Colors.Transparent
|
||||
HealthState.Green => ThemeKeys.StateGreen,
|
||||
HealthState.Yellow => ThemeKeys.StateYellow,
|
||||
HealthState.Red => ThemeKeys.StateRed,
|
||||
HealthState.Gray => ThemeKeys.StateGray,
|
||||
_ => ThemeKeys.PanelBackground2
|
||||
};
|
||||
}
|
||||
|
||||
public static string ToLabel(this HealthState state)
|
||||
public static string ToTextKey(this HealthState state)
|
||||
{
|
||||
return state switch
|
||||
{
|
||||
HealthState.Green => "Gut",
|
||||
HealthState.Yellow => "So lala",
|
||||
HealthState.Red => "Schlecht",
|
||||
HealthState.Gray => "Totalausfall",
|
||||
HealthState.Green => ThemeKeys.StatusGreenText,
|
||||
HealthState.Yellow => ThemeKeys.StatusYellowText,
|
||||
HealthState.Red => ThemeKeys.StatusRedText,
|
||||
HealthState.Gray => ThemeKeys.StatusGrayText,
|
||||
_ => ""
|
||||
};
|
||||
}
|
||||
|
||||
public static string ToFallbackText(this HealthState state)
|
||||
{
|
||||
return state switch
|
||||
{
|
||||
HealthState.Green => "Grün",
|
||||
HealthState.Yellow => "Gelb",
|
||||
HealthState.Red => "Rot",
|
||||
HealthState.Gray => "Grau",
|
||||
_ => ""
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user