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) { fn draw(&mut self, frame: &mut Frame, area: Rect) {
let block = Block::default() let block = Block::default()
.borders(Borders::ALL) .borders(Borders::ALL)
.border_set(ratatui::symbols::border::ROUNDED)
.title(" Confirm selections ") .title(" Confirm selections ")
.title_bottom(" [y] to continue, [n] to abort ") .title_bottom(" [y] to continue, [n] to abort ")
.title_alignment(Alignment::Center) .title_alignment(Alignment::Center)

View File

@ -123,7 +123,12 @@ impl Filter {
//Create the search bar widget //Create the search bar widget
let search_bar = Paragraph::new(display_text) 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)); .style(Style::default().fg(search_color));
//Render the search bar (First chunk of the screen) //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 // Define the Block with a border and background color
let block = Block::default() let block = Block::default()
.borders(Borders::ALL) .borders(Borders::ALL)
.border_set(ratatui::symbols::border::ROUNDED)
.title(self.mode_title.clone()) .title(self.mode_title.clone())
.title_alignment(ratatui::layout::Alignment::Center) .title_alignment(ratatui::layout::Alignment::Center)
.title_style(Style::default().reversed()) .title_style(Style::default().reversed())

View File

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

View File

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