fix(tui): play triangle indicator, kill on Esc, popup fg colors

This commit is contained in:
objz committed 2025-11-01 15:08:44 +01:00
1 parent 46087c47a8
commit 3e7a05b6e5
6 files changed
+57 -19

No files matched your search

+1 -10
View File
@@ -59,15 +59,6 @@ impl ContentTab {
}
}
fn spinner_char() -> char {
const FRAMES: &[char] = &['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
let ms = std::time::SystemTime::now()
.duration_since(std::time::UNIX_EPOCH)
.unwrap_or_default()
.as_millis();
FRAMES[(ms / 100) as usize % FRAMES.len()]
}
pub fn render(
frame: &mut Frame,
area: Rect,
@@ -182,7 +173,7 @@ pub fn title(
let run_state = crate::running::get(&inst.name);
let (prefix, prefix_style) = match run_state {
Some(RunState::Running) | Some(RunState::Starting) => (
format!("{} ", spinner_char()),
String::from("\u{25b6} "),
Style::default()
.fg(THEME.colors.success)
.add_modifier(Modifier::BOLD),
+5 -6
View File
@@ -448,12 +448,8 @@ fn close_popup(state: &mut WizardState, profiles_state: &mut profiles::State) {
}
fn wizard_title(_state: &WizardState) -> Line<'static> {
Line::styled(
"New Instance",
Style::default()
.fg(THEME.colors.foreground)
.add_modifier(Modifier::BOLD),
)
use crate::tui::widgets::styled_title;
styled_title("New Instance", true)
}
fn step_keybinds(state: &WizardState) -> ratatui::text::Line<'static> {
@@ -528,6 +524,7 @@ fn render_version_step(state: &WizardState, area: Rect, buf: &mut ratatui::buffe
.collect();
let list = List::new(items)
.style(Style::default().fg(THEME.colors.foreground))
.highlight_style(
Style::default()
.fg(THEME.colors.row_highlight)
@@ -556,6 +553,7 @@ fn render_loader_step(state: &WizardState, area: Rect, buf: &mut ratatui::buffer
.collect();
let list = List::new(items)
.style(Style::default().fg(THEME.colors.foreground))
.highlight_style(
Style::default()
.fg(THEME.colors.row_highlight)
@@ -598,6 +596,7 @@ fn render_loader_version_step(
.collect();
let list = List::new(items)
.style(Style::default().fg(THEME.colors.foreground))
.highlight_style(
Style::default()
.fg(THEME.colors.row_highlight)
+1 -1
View File
@@ -242,7 +242,7 @@ pub fn render(frame: &mut Frame, area: Rect, focused: FocusedArea, state: &mut S
let run_state = get_run_state(&instance.name);
let indicator = match &run_state {
Some(RunState::Running) | Some(RunState::Starting) => {
Span::styled("\u{25c9} ", Style::default().fg(THEME.colors.success))
Span::styled("\u{25b6} ", Style::default().fg(THEME.colors.success))
}
Some(RunState::Crashed(_)) => {
Span::styled("\u{2717} ", Style::default().fg(THEME.colors.error))