Skip to content

Commit

Permalink
Tree widget - WIP 23 - Add indentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
hydra committed Feb 4, 2025
1 parent 6f1485f commit 7921d30
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/widgets/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
//! }
//! ```
use std::fmt::{Debug, Formatter};
use figures::units::Lp;
use cushy::figures::units::Px;
use cushy::widget::{MakeWidget, WidgetRef, WrapperWidget};
use cushy::widgets::Space;
Expand Down Expand Up @@ -231,7 +232,11 @@ impl Tree {
let nodes = self.nodes.lock();
let node = nodes.get(&key).unwrap();

node.child_widget.clone()
let indent = Space::default().width(Lp::new(5));

indent
.and(node.child_widget.clone())
.into_columns()
.make_widget()
})
.collect();
Expand Down

0 comments on commit 7921d30

Please sign in to comment.