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:
@@ -0,0 +1,21 @@
|
||||
namespace cfs_tracker.Helpers;
|
||||
|
||||
public static class ThemeKeys
|
||||
{
|
||||
public const string AppBackground = "AppBackground";
|
||||
public const string PanelBackground = "PanelBackground";
|
||||
public const string PanelBackground2 = "PanelBackground2";
|
||||
public const string PanelBorder = "PanelBorder";
|
||||
public const string TextPrimary = "TextPrimary";
|
||||
public const string TextMuted = "TextMuted";
|
||||
|
||||
public const string StateGreen = "StateGreen";
|
||||
public const string StateYellow = "StateYellow";
|
||||
public const string StateRed = "StateRed";
|
||||
public const string StateGray = "StateGray";
|
||||
|
||||
public const string StatusGreenText = "StatusGreenText";
|
||||
public const string StatusYellowText = "StatusYellowText";
|
||||
public const string StatusRedText = "StatusRedText";
|
||||
public const string StatusGrayText = "StatusGrayText";
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using Microsoft.Maui.Controls;
|
||||
using Microsoft.Maui.Graphics;
|
||||
|
||||
namespace cfs_tracker.Helpers;
|
||||
|
||||
public static class ThemeResourceHelper
|
||||
{
|
||||
public static Color GetColor(string key, string fallbackHex = "#FFFFFF")
|
||||
{
|
||||
if (Application.Current?.Resources.TryGetValue(key, out var value) == true && value is Color color)
|
||||
return color;
|
||||
|
||||
return Color.FromArgb(fallbackHex);
|
||||
}
|
||||
|
||||
public static string GetString(string key, string fallback = "")
|
||||
{
|
||||
if (Application.Current?.Resources.TryGetValue(key, out var value) == true && value is string text)
|
||||
return text;
|
||||
|
||||
return fallback;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user