mirror of
https://github.com/forkless/NotAlterra.git
synced 2026-08-18 17:22:32 +02:00
Remove all status text from whale patrol row
This commit is contained in:
+3
-20
@@ -1152,26 +1152,9 @@ fn wait_for_key<B: Backend>(terminal: &mut Terminal<B>, app: &App) -> Result<()>
|
||||
let p = Paragraph::new(prompt_span)
|
||||
.alignment(Alignment::Center);
|
||||
f.render_widget(p, centered_bottom(f.area()));
|
||||
// Also show the status message if set
|
||||
if let Some(ref msg) = app.tui_state.status_message {
|
||||
let color = match app.tui_state.status_style {
|
||||
tui::StatusStyle::Success => Color::Green,
|
||||
tui::StatusStyle::Warning => Color::Yellow,
|
||||
tui::StatusStyle::Error => Color::Red,
|
||||
tui::StatusStyle::Info => Color::Cyan,
|
||||
tui::StatusStyle::Neutral => Color::Gray,
|
||||
};
|
||||
let line = Line::from(Span::styled(format!(" [{msg}]"), Style::default().fg(color)));
|
||||
f.render_widget(
|
||||
Paragraph::new(line),
|
||||
Rect {
|
||||
x: f.area().x,
|
||||
y: f.area().height.saturating_sub(2),
|
||||
width: f.area().width,
|
||||
height: 1,
|
||||
},
|
||||
);
|
||||
}
|
||||
// Whale at bottom
|
||||
let bar = Rect { x: 0, y: f.area().height.saturating_sub(1), width: f.area().width, height: 1 };
|
||||
tui::draw_whale_separator(f, bar, &app.tui_state);
|
||||
})?;
|
||||
if let Event::Key(_) = event::read()? {
|
||||
break;
|
||||
|
||||
+1
-26
@@ -591,37 +591,12 @@ fn draw_select_list_with_info(
|
||||
}
|
||||
|
||||
fn draw_status_bar(f: &mut Frame, area: Rect, app: &AppState) {
|
||||
if let Some(ref msg) = app.status_message {
|
||||
let color = match app.status_style {
|
||||
StatusStyle::Success => Color::Green,
|
||||
StatusStyle::Warning => Color::Yellow,
|
||||
StatusStyle::Error => Color::Red,
|
||||
StatusStyle::Info => Color::Cyan,
|
||||
StatusStyle::Neutral => Color::Gray,
|
||||
};
|
||||
|
||||
let icon = match app.status_style {
|
||||
StatusStyle::Success => "√",
|
||||
StatusStyle::Warning => "!",
|
||||
StatusStyle::Error => "×",
|
||||
StatusStyle::Info => "i",
|
||||
StatusStyle::Neutral => " ",
|
||||
};
|
||||
|
||||
let line = Line::from(vec![
|
||||
Span::styled(
|
||||
format!(" [{icon}] {msg}"),
|
||||
Style::default().fg(color),
|
||||
),
|
||||
]);
|
||||
f.render_widget(Paragraph::new(line), area);
|
||||
}
|
||||
draw_whale_separator(f, area, app);
|
||||
}
|
||||
|
||||
/// Separator line with a whale patrolling right-to-left.
|
||||
/// Disappears for ~10 s after reaching the left edge.
|
||||
fn draw_whale_separator(f: &mut Frame, area: Rect, app: &AppState) {
|
||||
pub fn draw_whale_separator(f: &mut Frame, area: Rect, app: &AppState) {
|
||||
if area.width < 4 { return; }
|
||||
let elapsed = app.whale_start.elapsed().as_millis() as u64;
|
||||
let bar_w = area.width as u64;
|
||||
|
||||
Reference in New Issue
Block a user