mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-06 10:58:28 +00:00
Prepare to support nested operations
This commit is contained in:
parent
ec6b444ec9
commit
97ce9f88ac
@ -78,7 +78,7 @@ impl TextRenderer {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
for (op, selected) in operations.operations().into_iter() {
|
for (op, selected, indent) in operations.operations().into_iter() {
|
||||||
let mut attrs = glyphon::Attrs::new();
|
let mut attrs = glyphon::Attrs::new();
|
||||||
|
|
||||||
if selected {
|
if selected {
|
||||||
@ -86,6 +86,11 @@ impl TextRenderer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let mut line = String::new();
|
let mut line = String::new();
|
||||||
|
|
||||||
|
for _ in 0..indent {
|
||||||
|
write!(line, "\t")?;
|
||||||
|
}
|
||||||
|
|
||||||
write!(line, "{op}")?;
|
write!(line, "{op}")?;
|
||||||
|
|
||||||
buffer.lines.push(glyphon::BufferLine::new(
|
buffer.lines.push(glyphon::BufferLine::new(
|
||||||
|
@ -16,7 +16,7 @@ impl OperationView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn operations(&self) -> Vec<(Self, bool)> {
|
pub fn operations(&self) -> Vec<(Self, bool, usize)> {
|
||||||
self.operation
|
self.operation
|
||||||
.children()
|
.children()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
@ -28,6 +28,7 @@ impl OperationView {
|
|||||||
selected: None,
|
selected: None,
|
||||||
},
|
},
|
||||||
Some(i) == self.selected,
|
Some(i) == self.selected,
|
||||||
|
0,
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.collect()
|
.collect()
|
||||||
@ -55,7 +56,7 @@ impl OperationView {
|
|||||||
self.operations()
|
self.operations()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.nth(selected)
|
.nth(selected)
|
||||||
.map(|(op, _)| op)
|
.map(|(op, _, _)| op)
|
||||||
})
|
})
|
||||||
.unwrap_or(self.clone())
|
.unwrap_or(self.clone())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user