MCPcopy Create free account
hub / github.com/evilsocket/cake / draw_tab_bar

Function draw_tab_bar

cake-cli/src/chat.rs:345–379  ·  view source on GitHub ↗
(frame: &mut Frame, app: &App, area: Rect)

Source from the content-addressed store, hash-verified

343}
344
345fn draw_tab_bar(frame: &mut Frame, app: &App, area: Rect) {
346 let chat_style = if app.tab == Tab::Chat {
347 Style::default()
348 .fg(Color::Yellow)
349 .add_modifier(Modifier::BOLD)
350 } else {
351 Style::default().fg(Color::DarkGray)
352 };
353 let cluster_style = if app.tab == Tab::Cluster {
354 Style::default()
355 .fg(Color::Yellow)
356 .add_modifier(Modifier::BOLD)
357 } else {
358 Style::default().fg(Color::DarkGray)
359 };
360
361 let mut spans = vec![
362 Span::raw(" "),
363 Span::styled("[1] Chat", chat_style),
364 Span::raw(" "),
365 Span::styled("[2] Cluster", cluster_style),
366 Span::raw(" "),
367 Span::styled(&app.server, Style::default().fg(Color::DarkGray)),
368 ];
369
370 if !app.status.is_empty() {
371 spans.push(Span::raw(" — "));
372 spans.push(Span::styled(
373 app.status.clone(),
374 Style::default().fg(Color::Green),
375 ));
376 }
377
378 frame.render_widget(Paragraph::new(Line::from(spans)), area);
379}
380
381fn draw_chat(frame: &mut Frame, app: &mut App, area: Rect) {
382 let layout = Layout::vertical([

Callers 1

drawFunction · 0.85

Calls 2

pushMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected