From a7dccf7990cd4fea2525dd85fe6220369495b6f3 Mon Sep 17 00:00:00 2001 From: Dark-Alex-17 Date: Tue, 8 Aug 2023 10:50:05 -0600 Subject: [PATCH] Fixed random bug in file info menu and added all blocks to be rounded borders --- src/event/mod.rs | 7 +++---- src/ui/radarr_ui/movie_details_ui.rs | 5 +++-- src/ui/utils.rs | 6 ++++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/event/mod.rs b/src/event/mod.rs index 4a2132d..f7f501b 100644 --- a/src/event/mod.rs +++ b/src/event/mod.rs @@ -1,8 +1,7 @@ pub use self::{ - input_event::{Events, InputEvent}, - key::Key + input_event::{Events, InputEvent}, + key::Key, }; -mod key; pub mod input_event; - +mod key; diff --git a/src/ui/radarr_ui/movie_details_ui.rs b/src/ui/radarr_ui/movie_details_ui.rs index e659a85..d967de9 100644 --- a/src/ui/radarr_ui/movie_details_ui.rs +++ b/src/ui/radarr_ui/movie_details_ui.rs @@ -109,7 +109,7 @@ fn draw_file_info(f: &mut Frame<'_, B>, app: &App, content_area: Rec let video_details = app.data.radarr_data.video_details.to_owned(); let chunks = vertical_chunks( vec![ - Constraint::Length(1), + Constraint::Length(2), Constraint::Length(5), Constraint::Length(1), Constraint::Length(6), @@ -125,7 +125,8 @@ fn draw_file_info(f: &mut Frame<'_, B>, app: &App, content_area: Rec audio_details_title.patch_style(style_bold()); video_details_title.patch_style(style_bold()); - let file_details_title_paragraph = Paragraph::new(file_details_title).block(borderless_block()); + let file_details_title_paragraph = + Paragraph::new(file_details_title).block(layout_block_top_border()); let audio_details_title_paragraph = Paragraph::new(audio_details_title).block(borderless_block()); let video_details_title_paragraph = diff --git a/src/ui/utils.rs b/src/ui/utils.rs index 9a0c293..450be6a 100644 --- a/src/ui/utils.rs +++ b/src/ui/utils.rs @@ -2,7 +2,7 @@ use tui::backend::Backend; use tui::layout::{Alignment, Constraint, Direction, Layout, Rect}; use tui::style::{Color, Modifier, Style}; use tui::text::{Span, Spans, Text}; -use tui::widgets::{Block, Borders, LineGauge, Paragraph, Wrap}; +use tui::widgets::{Block, BorderType, Borders, LineGauge, Paragraph, Wrap}; use tui::{symbols, Frame}; pub fn horizontal_chunks(constraints: Vec, size: Rect) -> Vec { @@ -46,7 +46,9 @@ fn layout_with_constraints(constraints: Vec) -> Layout { } pub fn layout_block<'a>() -> Block<'a> { - Block::default().borders(Borders::ALL) + Block::default() + .borders(Borders::ALL) + .border_type(BorderType::Rounded) } pub fn layout_block_with_title(title_span: Span<'_>) -> Block<'_> {