Implement Rounded corners (#918)

* add rounded corners

* more

* apply rounded corners to script boxes as well
This commit is contained in:
nyx 2024-11-06 15:01:19 -05:00 committed by GitHub
parent e463037e69
commit c36879e22f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 32 additions and 16 deletions

View File

@ -60,6 +60,7 @@ impl FloatContent for ConfirmPrompt {
fn draw(&mut self, frame: &mut Frame, area: Rect) {
let block = Block::default()
.borders(Borders::ALL)
.border_set(ratatui::symbols::border::ROUNDED)
.title(" Confirm selections ")
.title_bottom(" [y] to continue, [n] to abort ")
.title_alignment(Alignment::Center)

View File

@ -123,7 +123,12 @@ impl Filter {
//Create the search bar widget
let search_bar = Paragraph::new(display_text)
.block(Block::default().borders(Borders::ALL).title(" Search "))
.block(
Block::default()
.borders(Borders::ALL)
.border_set(ratatui::symbols::border::ROUNDED)
.title(" Search "),
)
.style(Style::default().fg(search_color));
//Render the search bar (First chunk of the screen)

View File

@ -216,6 +216,7 @@ impl FloatContent for FloatingText {
// Define the Block with a border and background color
let block = Block::default()
.borders(Borders::ALL)
.border_set(ratatui::symbols::border::ROUNDED)
.title(self.mode_title.clone())
.title_alignment(ratatui::layout::Alignment::Center)
.title_style(Style::default().reversed())

View File

@ -53,6 +53,7 @@ impl FloatContent for RunningCommand {
// Display a block indicating the command is running
Block::default()
.borders(Borders::ALL)
.border_set(ratatui::symbols::border::ROUNDED)
.title_top(Line::from("Running the command....").centered())
.title_style(Style::default().reversed())
.title_bottom(Line::from("Press Ctrl-C to KILL the command"))
@ -80,6 +81,7 @@ impl FloatContent for RunningCommand {
Block::default()
.borders(Borders::ALL)
.border_set(ratatui::symbols::border::ROUNDED)
.title_top(title_line.centered())
};

View File

@ -217,19 +217,19 @@ impl AppState {
self.drawable = true;
}
let label_block =
Block::default()
.borders(Borders::all())
.border_set(ratatui::symbols::border::Set {
top_left: " ",
top_right: " ",
bottom_left: " ",
bottom_right: " ",
vertical_left: " ",
vertical_right: " ",
horizontal_top: "*",
horizontal_bottom: "*",
});
let label_block = Block::default()
.borders(Borders::ALL)
.border_set(ratatui::symbols::border::ROUNDED)
.border_set(ratatui::symbols::border::Set {
top_left: " ",
top_right: " ",
bottom_left: " ",
bottom_right: " ",
vertical_left: " ",
vertical_right: " ",
horizontal_top: "*",
horizontal_bottom: "*",
});
let str1 = "Linutil ";
let str2 = "by Chris Titus";
let label = Paragraph::new(Line::from(vec![
@ -253,7 +253,8 @@ impl AppState {
let keybinds_block = Block::default()
.title(format!(" {} ", keybind_scope))
.borders(Borders::all());
.borders(Borders::ALL)
.border_set(ratatui::symbols::border::ROUNDED);
let keybinds = create_shortcut_list(shortcuts, keybind_render_width);
let n_lines = keybinds.len() as u16;
@ -297,7 +298,11 @@ impl AppState {
};
let list = List::new(tabs)
.block(Block::default().borders(Borders::ALL))
.block(
Block::default()
.borders(Borders::ALL)
.border_set(ratatui::symbols::border::ROUNDED),
)
.highlight_style(tab_hl_style)
.highlight_symbol(self.theme.tab_icon());
frame.render_stateful_widget(list, left_chunks[1], &mut self.current_tab);
@ -409,6 +414,7 @@ impl AppState {
.block(
Block::default()
.borders(Borders::ALL & !Borders::RIGHT)
.border_set(ratatui::symbols::border::ROUNDED)
.title(title)
.title_bottom(bottom_title),
)
@ -418,6 +424,7 @@ impl AppState {
let disclaimer_list = List::new(task_items).highlight_style(style).block(
Block::default()
.borders(Borders::ALL & !Borders::LEFT)
.border_set(ratatui::symbols::border::ROUNDED)
.title(task_list_title),
);