App 2.27.1: accent colour only for styles drawn in it
Settings → Display now has the Overview style first with the accent colour beside it; for styles with their own palette the accent field is greyed out with a note. Styles are an enum, OverviewStyle, with usesAccent (unit-tested). Emulator only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LhzAVaUyqcw5PkGjz4mWW6
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package com.evsuite.abrp;
|
||||
|
||||
/**
|
||||
* The Overview styles in the order of the Settings drop-down, the value each is stored as, and
|
||||
* whether it is drawn in the chosen accent colour. Styles with their own fixed palette (Retro's
|
||||
* display, the starship console, the cartoon, the blueprint, the terminal, the flight display,
|
||||
* the nixie tubes) ignore it, so Settings only offers the accent colour for the others. Pure
|
||||
* Java, unit-tested.
|
||||
*/
|
||||
enum OverviewStyle {
|
||||
TILES(true),
|
||||
GAUGES(true),
|
||||
COCKPIT(true),
|
||||
RETRO(false),
|
||||
RETRO_ACCENT(true),
|
||||
FUTURISTIC(true),
|
||||
SCIFI(false),
|
||||
CARTOON(false),
|
||||
BLUEPRINT(false),
|
||||
MG(true),
|
||||
MINIMAL(true),
|
||||
TERMINAL(false),
|
||||
AVIATION(false),
|
||||
NIXIE(false),
|
||||
CHRONOGRAPH(true);
|
||||
|
||||
static final String PREF_KEY = "overview_style";
|
||||
|
||||
/** Drawn in the accent colour, so the accent choice changes how it looks. */
|
||||
final boolean usesAccent;
|
||||
|
||||
OverviewStyle(boolean usesAccent) {
|
||||
this.usesAccent = usesAccent;
|
||||
}
|
||||
|
||||
/** The stored style; "DASHBOARD" (Gauges before 2.22.3) and anything unknown handled. */
|
||||
static OverviewStyle fromPref(String stored) {
|
||||
if ("DASHBOARD".equals(stored)) return GAUGES;
|
||||
for (OverviewStyle style : values()) {
|
||||
if (style.name().equals(stored)) return style;
|
||||
}
|
||||
return TILES;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user