Closed kdheepak closed 2 months ago
This PR adds a row! macro similar to the existing text! and line! macro.
row!
text!
line!
This will allow code like this:
let rows = [ Row::new([ Cell::from("\u{f002}"), Cell::from("Find File"), Cell::from(Text::raw("ctrl+f").alignment(ratatui::layout::Alignment::Right)), ]), Row::new([ Cell::from("\u{f021a}"), Cell::from("Open recent"), Cell::from(Text::raw("ctrl+r").alignment(ratatui::layout::Alignment::Right)), ]), Row::new([ Cell::from("\u{f0493}"), Cell::from("Open config"), Cell::from(Text::raw("ctrl+k").alignment(ratatui::layout::Alignment::Right)), ]), ];
to be written like
let rows = [ row!["\u{f002}", "Find File", text!["ctrl+f"].right_aligned()], row!["\u{f021a}", "Open recent", text!["ctrl+r"].right_aligned()], row!["\u{f0493}", "Open config", text!["ctrl+k"].right_aligned()], ];
I'm going to merge and address the comments here in another PR that makes these changes across all the files.
This PR adds a
row!
macro similar to the existingtext!
andline!
macro.This will allow code like this:
to be written like