Skip to content

Commit

Permalink
refactor: Make base title variable constant
Browse files Browse the repository at this point in the history
  • Loading branch information
lj3954 authored and adamperkowski committed Sep 20, 2024
1 parent dd8d8dd commit 14b6b5b
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions tui/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ use ratatui::{

const MIN_WIDTH: u16 = 77;
const MIN_HEIGHT: u16 = 19;
const TITLE: &str = concat!("Linux Toolbox - ", env!("BUILD_DATE"));

pub struct AppState {
/// Selected theme
Expand Down Expand Up @@ -243,15 +244,11 @@ impl AppState {
Style::new()
};

let title = format!(
"Linux Toolbox - {} {}",
env!("BUILD_DATE"),
if self.multi_select {
"[Multi-Select]"
} else {
""
}
);
let title = if self.multi_select {
&format!("{} [Multi-Select]", TITLE)
} else {
TITLE
};

#[cfg(feature = "tips")]
let bottom_title = Line::from(self.tip.bold().blue()).right_aligned();
Expand Down

0 comments on commit 14b6b5b

Please sign in to comment.