mirror of
https://codeberg.org/unspeaker/perch.git
synced 2025-12-06 09:36:42 +01:00
add modal overlay
This commit is contained in:
parent
f571b079b1
commit
1c4991c51b
2 changed files with 24 additions and 2 deletions
|
|
@ -5,6 +5,8 @@ impl Taggart {
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
pub fn save_begin (&mut self) {
|
pub fn save_begin (&mut self) {
|
||||||
self.mode = Some(Mode::Save { value: false })
|
if self.tasks.len() > 0 {
|
||||||
|
self.mode = Some(Mode::Save { value: false })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
22
src/view.rs
22
src/view.rs
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::*;
|
use crate::*;
|
||||||
pub(crate) use tengri::tui::ratatui::style::Color;//, Style}, prelude::Stylize};
|
pub(crate) use tengri::tui::ratatui::style::{Color, Modifier};
|
||||||
pub(crate) use pad::PadStr;
|
pub(crate) use pad::PadStr;
|
||||||
|
|
||||||
mod table; pub use self::table::*;
|
mod table; pub use self::table::*;
|
||||||
|
|
@ -26,6 +26,26 @@ impl Content<TuiOut> for Taggart {
|
||||||
let sized = |x|Bsp::b(sizer, Fill::xy(x));
|
let sized = |x|Bsp::b(sizer, Fill::xy(x));
|
||||||
value_bar(mode_bar(title_bar(sized(TreeTable(self)))))
|
value_bar(mode_bar(title_bar(sized(TreeTable(self)))))
|
||||||
}
|
}
|
||||||
|
fn render (&self, to: &mut TuiOut) {
|
||||||
|
self.content().render(to);
|
||||||
|
match self.mode {
|
||||||
|
Some(Mode::Save { value }) => {
|
||||||
|
to.tint_all(
|
||||||
|
Color::Rgb(96,96,96),
|
||||||
|
Color::Rgb(48,48,48),
|
||||||
|
Modifier::DIM
|
||||||
|
)
|
||||||
|
},
|
||||||
|
Some(Mode::Quit { value }) => {
|
||||||
|
to.tint_all(
|
||||||
|
Color::Rgb(96,96,96),
|
||||||
|
Color::Rgb(48,48,48),
|
||||||
|
Modifier::DIM
|
||||||
|
)
|
||||||
|
},
|
||||||
|
_ => {},
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Taggart {
|
impl Taggart {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue