Radish alpha
r
rad:z39mP9rQAaGmERfUMPULfPUi473tY
Radicle terminal user interface
Radicle
Git
bin: Introduce layout builder
Erik Kundt committed 1 year ago
commit 527c3dce203e853811e8421ead660ab96b77b5f5
parent a6d042c
2 files changed +18 -0
modified bin/ui.rs
@@ -1,6 +1,7 @@
pub mod format;
pub mod im;
pub mod items;
+
pub mod layout;
pub mod rm;
pub mod span;

added bin/ui/layout.rs
@@ -0,0 +1,17 @@
+
use ratatui::layout::{Constraint, Layout};
+

+
pub fn page() -> Layout {
+
    Layout::vertical([
+
        Constraint::Fill(1),
+
        Constraint::Length(1),
+
        Constraint::Length(1),
+
    ])
+
}
+

+
pub fn container() -> Layout {
+
    Layout::vertical([Constraint::Length(3), Constraint::Min(1)])
+
}
+

+
pub fn list_item() -> Layout {
+
    Layout::horizontal([Constraint::Ratio(1, 3), Constraint::Ratio(2, 3)])
+
}