mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-07 20:15:23 +00:00
update layout
This commit is contained in:
parent
e83fabbc0b
commit
ba86a24df4
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -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",
|
||||||
|
@ -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"
|
||||||
|
@ -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 {
|
||||||
|
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user