mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-15 05:33:07 +00:00
e17ca97136
Callbacks now include a path to the triggering view. The Cursive root can find the View corresponding to a ViewPath. In the future, ViewPaths may be returned when creating the layout.
16 lines
385 B
Rust
16 lines
385 B
Rust
/// Represents a path to a single view in the layout.
|
|
pub struct ViewPath {
|
|
/// List of turns to make on decision nodes when descending the view tree.
|
|
/// Simple nodes (with one fixed child) are skipped.
|
|
pub path: Vec<usize>,
|
|
}
|
|
|
|
impl ViewPath {
|
|
/// Creates a new empty path.
|
|
pub fn new() -> Self {
|
|
ViewPath {
|
|
path: Vec::new(),
|
|
}
|
|
}
|
|
}
|