Skip to content

Commit

Permalink
show version string in ui
Browse files Browse the repository at this point in the history
  • Loading branch information
palerdot committed Feb 1, 2024
1 parent 053109c commit 48670e2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/ui/keyboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,19 @@ use super::get_grid_color;
use crate::wordle::model::{KeyboardHints, LetterState};

pub fn draw(frame: &mut Frame, rect: Rect, hints: &mut KeyboardHints) {
let github_link = String::from("https://github.com/palerdot/wordl-rs");
let version = env!("CARGO_PKG_VERSION");

let version_string = if version.is_empty() {
"".into()
} else {
format!(" (v{})", version)
};

let title_text = format!(" {}{} ", github_link, version_string);

let master_block = Block::new()
.title(Title::from(" https://github.com/palerdot/wordl-rs ").alignment(Alignment::Center))
.title(Title::from(title_text).alignment(Alignment::Center))
.borders(Borders::TOP)
// .border_style(Style::new().fg(Color::Rgb(255, 0, 0)))
.border_style(Style::new().fg(Color::Cyan))
Expand Down

0 comments on commit 48670e2

Please sign in to comment.