Two themes, and one place that decides what colour a station is
Colours came from static brushes scattered over the windows. They now come from a Theme, and everything that paints a station, a spot or a log row asks Themes.Current as it paints, so changing the theme changes every window without reopening it. light is N1MM's own palette, read out of ApplicationStyles: the pale blue behind a window, ivory on a button, white boxes, and the four colours a station is painted in. dark is the same states in colours for a dark screen, which is roughly what the program looked like before. Config > Manage Skins, Colors and Fonts picks one, under N1MM's name for the same dialog, and shows what each theme paints a callsign. The choice is kept in settings.json as Theme, and light is the default. The window chrome follows through resources the Fluent controls read, so a text box and a button take the theme's colours in every state. Fonts and skins are not part of it. Looked at under Xvfb in both themes: the entry window, the theme dialog, and the log window with its rows still coloured by what each contact was worth. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+15
-23
@@ -1,31 +1,28 @@
|
||||
using Avalonia.Media;
|
||||
using Nonemm.App.Theming;
|
||||
using Nonemm.Contests;
|
||||
|
||||
namespace Nonemm.App;
|
||||
|
||||
/// One place decides what colour a station is, so the callsign box, the frame
|
||||
/// above it, a row in the check window and a spot on the bandmap cannot
|
||||
/// disagree. The colours are N1MM's own defaults, from ApplicationStyles:
|
||||
/// QColor, MultColor, MultiMultColor and DupeColor.
|
||||
/// disagree. The colours come from the theme in use.
|
||||
public static class Verdicts
|
||||
{
|
||||
/// Worth a contact but no new multiplier.
|
||||
public static readonly IBrush Worth = new SolidColorBrush(Color.FromRgb(0x00, 0x00, 0xFF));
|
||||
public static IBrush Worth => Themes.Brush(Themes.Current.Worth);
|
||||
|
||||
/// New in one multiplier.
|
||||
public static readonly IBrush NewMultiplier = new SolidColorBrush(Color.FromRgb(0xE8, 0x00, 0x00));
|
||||
public static IBrush NewMultiplier => Themes.Brush(Themes.Current.Multiplier);
|
||||
|
||||
/// New in more than one, which is worth turning the radio for.
|
||||
public static readonly IBrush NewMultipliers = new SolidColorBrush(Color.FromRgb(0x0D, 0x9D, 0x0D));
|
||||
public static IBrush NewMultipliers => Themes.Brush(Themes.Current.Multipliers);
|
||||
|
||||
public static readonly IBrush Dupe = new SolidColorBrush(Color.FromRgb(0x80, 0x80, 0x80));
|
||||
public static IBrush Dupe => Themes.Brush(Themes.Current.Dupe);
|
||||
|
||||
public static readonly IBrush Nothing = Dupe;
|
||||
public static IBrush Nothing => Dupe;
|
||||
|
||||
/// The frequency we are calling CQ on.
|
||||
public static readonly IBrush Cq = new SolidColorBrush(Color.FromRgb(0xFF, 0x00, 0x00));
|
||||
public static IBrush Cq => Themes.Brush(Themes.Current.Cq);
|
||||
|
||||
/// Nothing typed yet is the same blue as a station worth working: that is
|
||||
/// Nothing typed yet is the same colour as a station worth working: that is
|
||||
/// what N1MM leaves the callsign box.
|
||||
public static IBrush Colour(Verdict? verdict) =>
|
||||
verdict is null ? Worth
|
||||
@@ -35,18 +32,13 @@ public static class Verdicts
|
||||
: Worth;
|
||||
|
||||
/// The same four states as backgrounds, which is what N1MM paints behind a
|
||||
/// spot: QBackColor, MultBackColor and DupeBackColor.
|
||||
/// spot.
|
||||
public static IBrush Background(Verdict? verdict) =>
|
||||
verdict is null ? WorthBack
|
||||
: verdict.IsDupe ? DupeBack
|
||||
: verdict.NewMultipliers.Count > 0 ? MultiplierBack
|
||||
: WorthBack;
|
||||
|
||||
private static readonly IBrush WorthBack = new SolidColorBrush(Color.FromRgb(0x51, 0xA8, 0xFF));
|
||||
|
||||
private static readonly IBrush MultiplierBack = new SolidColorBrush(Color.FromRgb(0xFF, 0x37, 0x37));
|
||||
|
||||
private static readonly IBrush DupeBack = new SolidColorBrush(Color.FromRgb(0xD4, 0xD4, 0xD4));
|
||||
verdict is null ? Themes.Brush(Themes.Current.WorthBackground)
|
||||
: verdict.IsDupe ? Themes.Brush(Themes.Current.DupeBackground)
|
||||
: verdict.NewMultipliers.Count > 1 ? Themes.Brush(Themes.Current.MultipliersBackground)
|
||||
: verdict.NewMultipliers.Count == 1 ? Themes.Brush(Themes.Current.MultiplierBackground)
|
||||
: Themes.Brush(Themes.Current.WorthBackground);
|
||||
|
||||
public static string Describe(Verdict? verdict)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user