diff options
author | Clement Tsang <34804052+ClementTsang@users.noreply.github.com> | 2024-01-02 06:24:13 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-02 01:24:13 -0500 |
commit | 77777ef5887c2e1bd1a10c55cbb329c0471d4388 (patch) | |
tree | 725723ae820d372b5c31870c0dbceefd82a7d703 /src/canvas.rs | |
parent | c242b4aff31696e24ebbae49cfb5e761d0c6a9c0 (diff) |
refactor: clean up some more drawing/component code (#1372)
* rename battery info widget file
* add widget trait
* move basic table arrows over
* some renaming
* more renaming and shuffling
* cleanup
* fmt
Diffstat (limited to 'src/canvas.rs')
-rw-r--r-- | src/canvas.rs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/canvas.rs b/src/canvas.rs index 6b18f1c7..38194f04 100644 --- a/src/canvas.rs +++ b/src/canvas.rs @@ -1,7 +1,7 @@ +pub mod components; mod dialogs; mod drawing_utils; pub mod styling; -pub mod tui_widgets; mod widgets; use std::str::FromStr; @@ -49,7 +49,7 @@ impl FromStr for ColourScheme { "nord" => Ok(ColourScheme::Nord), "nord-light" => Ok(ColourScheme::NordLight), _ => Err(BottomError::ConfigError(format!( - "\"{s}\" is an invalid built-in color scheme." + "`{s}` is an invalid built-in color scheme." ))), } } @@ -71,8 +71,10 @@ pub struct Painter { widget_layout: BottomLayout, } -// Part of a temporary fix for https://github.com/ClementTsang/bottom/issues/896 -enum LayoutConstraint { +/// The constraints of a widget relative to its parent. +/// +/// This is used over ratatui's internal representation due to https://github.com/ClementTsang/bottom/issues/896. +pub enum LayoutConstraint { CanvasHandled, Grow, Ratio(u32, u32), |