Fixed random bug in file info menu and added all blocks to be rounded borders
This commit is contained in:
+2
-3
@@ -1,8 +1,7 @@
|
|||||||
pub use self::{
|
pub use self::{
|
||||||
input_event::{Events, InputEvent},
|
input_event::{Events, InputEvent},
|
||||||
key::Key
|
key::Key,
|
||||||
};
|
};
|
||||||
|
|
||||||
mod key;
|
|
||||||
pub mod input_event;
|
pub mod input_event;
|
||||||
|
mod key;
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ fn draw_file_info<B: Backend>(f: &mut Frame<'_, B>, app: &App, content_area: Rec
|
|||||||
let video_details = app.data.radarr_data.video_details.to_owned();
|
let video_details = app.data.radarr_data.video_details.to_owned();
|
||||||
let chunks = vertical_chunks(
|
let chunks = vertical_chunks(
|
||||||
vec![
|
vec![
|
||||||
Constraint::Length(1),
|
Constraint::Length(2),
|
||||||
Constraint::Length(5),
|
Constraint::Length(5),
|
||||||
Constraint::Length(1),
|
Constraint::Length(1),
|
||||||
Constraint::Length(6),
|
Constraint::Length(6),
|
||||||
@@ -125,7 +125,8 @@ fn draw_file_info<B: Backend>(f: &mut Frame<'_, B>, app: &App, content_area: Rec
|
|||||||
audio_details_title.patch_style(style_bold());
|
audio_details_title.patch_style(style_bold());
|
||||||
video_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 =
|
let audio_details_title_paragraph =
|
||||||
Paragraph::new(audio_details_title).block(borderless_block());
|
Paragraph::new(audio_details_title).block(borderless_block());
|
||||||
let video_details_title_paragraph =
|
let video_details_title_paragraph =
|
||||||
|
|||||||
+4
-2
@@ -2,7 +2,7 @@ use tui::backend::Backend;
|
|||||||
use tui::layout::{Alignment, Constraint, Direction, Layout, Rect};
|
use tui::layout::{Alignment, Constraint, Direction, Layout, Rect};
|
||||||
use tui::style::{Color, Modifier, Style};
|
use tui::style::{Color, Modifier, Style};
|
||||||
use tui::text::{Span, Spans, Text};
|
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};
|
use tui::{symbols, Frame};
|
||||||
|
|
||||||
pub fn horizontal_chunks(constraints: Vec<Constraint>, size: Rect) -> Vec<Rect> {
|
pub fn horizontal_chunks(constraints: Vec<Constraint>, size: Rect) -> Vec<Rect> {
|
||||||
@@ -46,7 +46,9 @@ fn layout_with_constraints(constraints: Vec<Constraint>) -> Layout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn layout_block<'a>() -> Block<'a> {
|
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<'_> {
|
pub fn layout_block_with_title(title_span: Span<'_>) -> Block<'_> {
|
||||||
|
|||||||
Reference in New Issue
Block a user