generated from GarandPLG/rust-flake-template
Add block title helpers and use them in UI
This commit is contained in:
1 parent
1d1dc0f2f7
commit
9719e1ba6b
5 files changed
+115
-15
No files matched your search
@@ -1,9 +1,12 @@
|
||||
use crate::app::keybindings::{Action, Group, KeyBinding, binding_for};
|
||||
use crate::app::{
|
||||
helpers::block_single_title_helper,
|
||||
keybindings::{Action, Group, KeyBinding, binding_for},
|
||||
};
|
||||
use clap::ValueEnum;
|
||||
use ratatui::{
|
||||
buffer::Buffer,
|
||||
layout::{Alignment, Constraint, Layout, Rect},
|
||||
style::Stylize,
|
||||
style::{Color, Stylize},
|
||||
text::Line,
|
||||
widgets::{Block, Borders, Padding, Paragraph, Widget},
|
||||
};
|
||||
@@ -72,11 +75,7 @@ impl Widget for KeybindingsWidget {
|
||||
|
||||
let block: Block<'_> = Block::default()
|
||||
.borders(Borders::ALL)
|
||||
.title(Line::from_iter([
|
||||
"[ ".gray(),
|
||||
"Keybindings".magenta(),
|
||||
" ]".gray(),
|
||||
]));
|
||||
.title(block_single_title_helper("Keybindings", Color::Magenta));
|
||||
|
||||
let inner: Rect = block.inner(area);
|
||||
|
||||
|
||||
Reference in new issue
Block a user