diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-02 14:05:30 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2024-08-02 14:05:30 +0200 |
| commit | 555a45a9f2b68a48b098099804ce795e3d5a350b (patch) | |
| tree | c13dbfc5e380f9c2b21fa87ce889a6379fef44b2 /src/config | |
| parent | 04a5a938994ddb95cfaa9a74b180e457d3a2b5d0 (diff) | |
sheetview add background theme parameter
Diffstat (limited to 'src/config')
| -rw-r--r-- | src/config/theme/sheetview.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/config/theme/sheetview.rs b/src/config/theme/sheetview.rs index bcd53e1..af0b585 100644 --- a/src/config/theme/sheetview.rs +++ b/src/config/theme/sheetview.rs @@ -10,6 +10,7 @@ pub struct SheetViewTheme { pub cursor: EvalTo<Style, CellRef>, pub selection: EvalTo<Style, CellRef>, pub cell: EvalTo<Style, CellRef>, + pub background: EvalTo<Style, ()>, } impl SheetViewTheme { @@ -18,6 +19,7 @@ impl SheetViewTheme { cursor: EvalTo::Value(Style::new().fg(Color::Black).bg(Color::White)), selection: EvalTo::Value(Style::new().fg(Color::White).bg(Color::DarkGray)), cell: EvalTo::Value(Style::new().fg(Color::White).bg(Color::Black)), + background: EvalTo::Value(Style::new().bg(Color::Black)), } } } @@ -44,17 +46,21 @@ impl UserData for SheetViewTheme { }); fields.add_field_function_get("selection", |_, _| Ok(cfg!().selection.clone())); - fields.add_field_function_set("selection", |_, _, pair: EvalTo<Style, CellRef>| { cfg_mut!().selection = pair; Ok(()) }); fields.add_field_function_get("cell", |_, _| Ok(cfg!().cell.clone())); - fields.add_field_function_set("cell", |_, _, cell: EvalTo<Style, CellRef>| { cfg_mut!().cell = cell; Ok(()) }); + + fields.add_field_function_get("background", |_, _| Ok(cfg!().background.clone())); + fields.add_field_function_set("background", |_, _, background: EvalTo<Style, ()>| { + cfg_mut!().background = background; + Ok(()) + }); } } |