more on themes
This commit is contained in:
@@ -80,9 +80,9 @@ Research URLs:
|
||||
`~/.config/rogue-agenda/preferences.toml`: theme, command bar, rule/return/item
|
||||
markers, autosave, confirmations, date/time display, and number separators;
|
||||
predefined values use Space-open keyboard/mouse choice popovers.
|
||||
- [x] Seven bundled palettes: Lotus-inspired Classic, Mono, Amber, Nord,
|
||||
Solarized Dark, Solarized Light, and Catppuccin Mocha. The four modern themes
|
||||
enforce at least 7:1 selected-row contrast without changing the original three.
|
||||
- [x] Six bundled palettes: Lotus-inspired Classic, Mono, Amber, Greenscreen,
|
||||
Nord, and Catppuccin Mocha. The three additional themes enforce at least 7:1
|
||||
selected-row contrast without changing the original three.
|
||||
- [x] Dedicated, contrast-checked canvas-heading colors across all themes for
|
||||
column titles, sections, Datebook dates, aggregates, and empty-view messages.
|
||||
- [x] Transactional per-document settings embedded in `.agnd`: description,
|
||||
|
||||
12
README.md
12
README.md
@@ -116,18 +116,18 @@ bottom command strip.
|
||||
Press `F10`, then `p` for application-wide Preferences. Rogue Agenda saves these
|
||||
as typed TOML at `~/.config/rogue-agenda/preferences.toml`. The screen controls:
|
||||
|
||||
- `classic`, `mono`, `amber`, `nord`, `solarized-dark`, `solarized-light`, and
|
||||
`catppuccin-mocha` themes
|
||||
- `classic`, `mono`, `amber`, `greenscreen`, `nord`, and `catppuccin-mocha`
|
||||
themes
|
||||
- function-key command bar and category-rule detail visibility
|
||||
- carriage-return and item markers
|
||||
- autosave checkpoint interval and destructive-action confirmations
|
||||
- ISO, US, European, or long date display and 12/24-hour time
|
||||
- decimal and thousands separators
|
||||
|
||||
Nord, both Solarized variants, and Catppuccin Mocha use dedicated selected-row
|
||||
foreground/background pairs with at least 7:1 relative-luminance contrast. Every
|
||||
theme also defines a contrast-checked canvas-heading color for column titles,
|
||||
sections, dates, aggregate rows, and empty-view messages.
|
||||
Greenscreen, Nord, and Catppuccin Mocha use dedicated selected-row
|
||||
foreground/background pairs with at least 7:1 relative-luminance contrast.
|
||||
Every theme also defines a contrast-checked canvas-heading color for column
|
||||
titles, sections, dates, aggregate rows, and empty-view messages.
|
||||
|
||||
The file is created when Preferences are first saved. It can also be edited with
|
||||
a text editor while Rogue Agenda is closed; unknown keys and invalid values are
|
||||
|
||||
@@ -1183,9 +1183,8 @@ pub(crate) fn form_choices(kind: &FormKind, field: usize) -> Option<Vec<ChoiceOp
|
||||
("Classic — Lotus-inspired blue", "classic"),
|
||||
("Mono — grayscale", "mono"),
|
||||
("Amber — warm dark", "amber"),
|
||||
("Greenscreen — muted phosphor green", "greenscreen"),
|
||||
("Nord — arctic blue dark", "nord"),
|
||||
("Solarized Dark — balanced low contrast", "solarized-dark"),
|
||||
("Solarized Light — warm paper light", "solarized-light"),
|
||||
("Catppuccin Mocha — cozy pastel dark", "catppuccin-mocha"),
|
||||
],
|
||||
1..=3 | 6 | 8 => YES_NO_CHOICES,
|
||||
|
||||
@@ -90,17 +90,11 @@ impl AppPreferences {
|
||||
pub fn validate(&self) -> Result<()> {
|
||||
if !matches!(
|
||||
self.theme.as_str(),
|
||||
"classic"
|
||||
| "mono"
|
||||
| "amber"
|
||||
| "nord"
|
||||
| "solarized-dark"
|
||||
| "solarized-light"
|
||||
| "catppuccin-mocha"
|
||||
"classic" | "mono" | "amber" | "greenscreen" | "nord" | "catppuccin-mocha"
|
||||
) {
|
||||
bail!(
|
||||
"theme must be classic, mono, amber, nord, solarized-dark, \
|
||||
solarized-light, or catppuccin-mocha"
|
||||
"theme must be classic, mono, amber, greenscreen, nord, or \
|
||||
catppuccin-mocha"
|
||||
)
|
||||
}
|
||||
if !matches!(
|
||||
@@ -170,9 +164,8 @@ mod tests {
|
||||
"classic",
|
||||
"mono",
|
||||
"amber",
|
||||
"greenscreen",
|
||||
"nord",
|
||||
"solarized-dark",
|
||||
"solarized-light",
|
||||
"catppuccin-mocha",
|
||||
] {
|
||||
let preferences = AppPreferences {
|
||||
|
||||
45
src/ui.rs
45
src/ui.rs
@@ -47,6 +47,15 @@ fn palette(theme: &str) -> Palette {
|
||||
selection_foreground: rgb(0xffffff),
|
||||
foreground: Color::Rgb(255, 191, 0),
|
||||
},
|
||||
"greenscreen" => Palette {
|
||||
primary: Color::Black,
|
||||
accent: rgb(0x79a86b),
|
||||
canvas: rgb(0x030704),
|
||||
canvas_heading: rgb(0x9ac58d),
|
||||
selection: rgb(0x284b2f),
|
||||
selection_foreground: rgb(0xdce8d8),
|
||||
foreground: rgb(0x8fbd80),
|
||||
},
|
||||
"nord" => Palette {
|
||||
primary: rgb(0x2e3440),
|
||||
accent: rgb(0x88c0d0),
|
||||
@@ -56,24 +65,6 @@ fn palette(theme: &str) -> Palette {
|
||||
selection_foreground: rgb(0x2e3440),
|
||||
foreground: rgb(0xeceff4),
|
||||
},
|
||||
"solarized-dark" => Palette {
|
||||
primary: rgb(0x002b36),
|
||||
accent: rgb(0x2aa198),
|
||||
canvas: rgb(0x073642),
|
||||
canvas_heading: rgb(0xfdf6e3),
|
||||
selection: rgb(0xfdf6e3),
|
||||
selection_foreground: rgb(0x002b36),
|
||||
foreground: rgb(0x839496),
|
||||
},
|
||||
"solarized-light" => Palette {
|
||||
primary: rgb(0x586e75),
|
||||
accent: rgb(0xeee8d5),
|
||||
canvas: rgb(0xfdf6e3),
|
||||
canvas_heading: rgb(0x002b36),
|
||||
selection: rgb(0x002b36),
|
||||
selection_foreground: rgb(0xfdf6e3),
|
||||
foreground: rgb(0x657b83),
|
||||
},
|
||||
"catppuccin-mocha" => Palette {
|
||||
primary: rgb(0x181825),
|
||||
accent: rgb(0xcba6f7),
|
||||
@@ -1433,9 +1424,8 @@ mod tests {
|
||||
.collect::<String>();
|
||||
assert!(screen.contains("Classic — Lotus-inspired blue"));
|
||||
assert!(screen.contains("Amber — warm dark"));
|
||||
assert!(screen.contains("Greenscreen — muted phosphor green"));
|
||||
assert!(screen.contains("Nord — arctic blue dark"));
|
||||
assert!(screen.contains("Solarized Dark — balanced low contrast"));
|
||||
assert!(screen.contains("Solarized Light — warm paper light"));
|
||||
assert!(screen.contains("Catppuccin Mocha — cozy pastel dark"));
|
||||
|
||||
app.handle_key(KeyEvent::new(KeyCode::Down, KeyModifiers::NONE))
|
||||
@@ -1463,9 +1453,8 @@ mod tests {
|
||||
};
|
||||
assert_eq!(form.values[0], "amber");
|
||||
|
||||
assert_eq!(palette("greenscreen").foreground, Color::Rgb(143, 189, 128));
|
||||
assert_eq!(palette("nord").primary, Color::Rgb(46, 52, 64));
|
||||
assert_eq!(palette("solarized-dark").canvas, Color::Rgb(7, 54, 66));
|
||||
assert_eq!(palette("solarized-light").canvas, Color::Rgb(253, 246, 227));
|
||||
assert_eq!(
|
||||
palette("catppuccin-mocha").foreground,
|
||||
Color::Rgb(205, 214, 244)
|
||||
@@ -1482,13 +1471,8 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn added_themes_keep_selected_rows_at_high_contrast() {
|
||||
for theme in [
|
||||
"nord",
|
||||
"solarized-dark",
|
||||
"solarized-light",
|
||||
"catppuccin-mocha",
|
||||
] {
|
||||
fn additional_themes_keep_selected_rows_at_high_contrast() {
|
||||
for theme in ["greenscreen", "nord", "catppuccin-mocha"] {
|
||||
let colors = palette(theme);
|
||||
let ratio = contrast_ratio(colors.selection_foreground, colors.selection);
|
||||
assert!(
|
||||
@@ -1504,9 +1488,8 @@ mod tests {
|
||||
"classic",
|
||||
"mono",
|
||||
"amber",
|
||||
"greenscreen",
|
||||
"nord",
|
||||
"solarized-dark",
|
||||
"solarized-light",
|
||||
"catppuccin-mocha",
|
||||
] {
|
||||
let colors = palette(theme);
|
||||
|
||||
Reference in New Issue
Block a user