update layout

This commit is contained in:
Alexandre Pasmantier 2024-10-14 23:35:42 +02:00
parent e83fabbc0b
commit ba86a24df4
4 changed files with 6 additions and 5 deletions

2
Cargo.lock generated
View File

@ -2419,7 +2419,7 @@ dependencies = [
[[package]] [[package]]
name = "television" name = "television"
version = "0.1.2" version = "0.1.3"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"better-panic", "better-panic",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "television" name = "television"
version = "0.1.2" version = "0.1.3"
edition = "2021" edition = "2021"
description = "The revolution will be televised." description = "The revolution will be televised."
license = "MIT" license = "MIT"

View File

@ -389,9 +389,9 @@ impl Television {
/// ///
/// * `Result<()>` - An Ok result or an error. /// * `Result<()>` - An Ok result or an error.
pub fn draw(&mut self, frame: &mut Frame, area: Rect) -> Result<()> { pub fn draw(&mut self, frame: &mut Frame, area: Rect) -> Result<()> {
//let layout = Layout::all_panes_centered(Dimensions::default(), area); let layout = Layout::all_panes_centered(Dimensions::default(), area);
let layout = //let layout =
Layout::results_only_centered(Dimensions::new(40, 60), area); // Layout::results_only_centered(Dimensions::new(40, 60), area);
self.results_area_height = u32::from(layout.results.height); self.results_area_height = u32::from(layout.results.height);
if let Some(preview_window) = layout.preview_window { if let Some(preview_window) = layout.preview_window {

View File

@ -74,6 +74,7 @@ impl Layout {
} }
/// TODO: add diagram /// TODO: add diagram
#[allow(dead_code)]
pub fn results_only_centered(dimensions: Dimensions, area: Rect) -> Self { pub fn results_only_centered(dimensions: Dimensions, area: Rect) -> Self {
let main_block = centered_rect(dimensions.x, dimensions.y, area); let main_block = centered_rect(dimensions.x, dimensions.y, area);
// split the main block into two vertical chunks // split the main block into two vertical chunks