separate render/content macros; add has_jack

This commit is contained in:
🪞👃🪞 2025-01-14 12:41:27 +01:00
parent 08184f9906
commit e62e36d558
19 changed files with 183 additions and 226 deletions

View file

@ -1,13 +1,11 @@
use crate::*;
pub struct Bordered<S: BorderStyle, W: Content<TuiOut>>(pub S, pub W);
render!(TuiOut: (self: Bordered<S: BorderStyle, W: Content<TuiOut>>) => {
Fill::xy(lay!(Border(self.0), Padding::xy(1, 1, &self.1)))
});
content!(TuiOut: |self: Bordered<S: BorderStyle, W: Content<TuiOut>>|Fill::xy(
lay!(Border(self.0), Padding::xy(1, 1, &self.1))
));
pub struct Border<S: BorderStyle>(pub S);
render!(TuiOut: |self: Border<S: BorderStyle>, to| {
let area = to.area();
if area.w() > 0 && area.y() > 0 {

View file

@ -20,7 +20,7 @@ pub enum FileBrowserCommand {
Chdir(PathBuf),
Filter(Arc<str>),
}
render!(TuiOut: (self: FileBrowser) => /*Stack::down(|add|{
content!(TuiOut: |self: FileBrowser| /*Stack::down(|add|{
let mut i = 0;
for (_, name) in self.dirs.iter() {
if i >= self.scroll {