fix: preserve terminal background between bar elements
This commit is contained in:
@@ -14,4 +14,6 @@
|
||||
- [x] use the proper ending character in the family of `├` instead of that character all the way down.
|
||||
- [x] remove this top-most line above the panels on the right-hand side: `dbdash │ SQLite │ READ ONLY`.
|
||||
- [x] highlight the current cell isntead of just the current row in the results pane.
|
||||
- [x] put the help text inside it's own pane so it fits the design more cleanly.
|
||||
- [x] put the help text inside it's own pane so it fits the design more cleanly.
|
||||
- [ ] move the table name in the results pane from the bottom-left border title to top-right border title instead
|
||||
- [ ] remove the bottom navigation help panel and have a keybinding overview appear in a floating window when pressing `?` in normal mode
|
||||
+27
-1
@@ -354,7 +354,7 @@ fn draw_bars(
|
||||
insert: bool,
|
||||
position: Option<(usize, usize)>,
|
||||
) {
|
||||
let base = Style::default().bg(Color::DarkGray).fg(Color::White);
|
||||
let base = Style::default();
|
||||
let badge = Style::default().bg(Color::Cyan).fg(Color::Black);
|
||||
let edge = base.fg(Color::Cyan);
|
||||
frame.render_widget(
|
||||
@@ -1060,6 +1060,32 @@ mod tests {
|
||||
assert!(form.input().is_some());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bar_background_is_default_outside_badges() -> Result<()> {
|
||||
let mut terminal = ratatui::Terminal::new(ratatui::backend::TestBackend::new(80, 8))?;
|
||||
terminal.draw(|frame| {
|
||||
let [top, _, bottom] = shell_areas(frame.area());
|
||||
draw_bars(
|
||||
frame,
|
||||
top,
|
||||
bottom,
|
||||
"SQLite",
|
||||
"example.sqlite",
|
||||
false,
|
||||
Some((1, 1)),
|
||||
);
|
||||
})?;
|
||||
let buffer = terminal.backend().buffer();
|
||||
for y in [0, 7] {
|
||||
for x in [9, 20, 40, 60] {
|
||||
assert_eq!(buffer[(x, y)].bg, Color::Reset);
|
||||
}
|
||||
assert_eq!(buffer[(0, y)].bg, Color::Cyan);
|
||||
}
|
||||
assert_eq!(buffer[(79, 7)].bg, Color::Cyan);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn shell_keeps_position_when_name_is_long_and_yields_on_short_screens() -> Result<()> {
|
||||
let mut terminal = ratatui::Terminal::new(ratatui::backend::TestBackend::new(24, 8))?;
|
||||
|
||||
@@ -43,6 +43,7 @@ Navigation:
|
||||
Enter on the connected database collapses/expands it without reconnecting.
|
||||
Navigation help has its own bordered pane and wraps when needed.
|
||||
Full-width bars show dbdash/provider/READ ONLY above and mode/database below.
|
||||
Only badges have colored backgrounds; the remaining bar area uses terminal defaults.
|
||||
Focused inputs show one-based line:column (Unicode characters, not screen cells).
|
||||
The query editor sits above rows/results; the explorer spans both panes.
|
||||
Explorer and rows/schema bottom borders align; relation/page/column status
|
||||
|
||||
Reference in New Issue
Block a user