A simple CPU rendered GUI IDE experience.
Diffstat (limited to 'src/bar.rs')
-rw-r--r--src/bar.rs16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/bar.rs b/src/bar.rs
index beaee4b..a624aa8 100644
--- a/src/bar.rs
+++ b/src/bar.rs
@@ -52,7 +52,7 @@ impl Bar {
.zip(self.last_action.chars().rev())
.for_each(|(x, y)| x.letter = Some(y));
}
- State::Procure((x, r)) => {
+ State::Procure(x, r) => {
r.prompt()
.chars()
.zip(repeat(Style::BOLD | Style::ITALIC))
@@ -65,6 +65,18 @@ impl Bar {
}
});
}
+ State::RequestBoolean(x) => {
+ x.prompt()
+ .chars()
+ .zip(repeat(Style::BOLD | Style::ITALIC))
+ .zip(row)
+ .for_each(|((x, z), y)| {
+ *y = Cell {
+ letter: Some(x),
+ style: Style { flags: z, ..y.style },
+ }
+ });
+ }
State::Selection(x) => {
let [(x1, y1), (x2, y2)] = t.position(x.clone());
format!("selection from ({x1}, {y1}) to ({x2}, {y2})")
@@ -73,7 +85,7 @@ impl Bar {
.zip(row.iter_mut().rev())
.for_each(|(x, y)| y.letter = Some(x));
}
- State::Search((x, y, z)) => {
+ State::Search(x, y, z) => {
format!("{} ({} of {z})", x.as_str(), y + 1)
.chars()
.zip(row)