mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 12:46:42 +01:00
This commit is contained in:
parent
573534a9a6
commit
447638ee71
30 changed files with 824 additions and 548 deletions
|
|
@ -1,19 +1,24 @@
|
|||
use crate::*;
|
||||
|
||||
content!(TuiOut: |self: Dialog| match self {
|
||||
Self::Menu(_) =>
|
||||
self.view_dialog_menu().boxed(),
|
||||
Self::Help(offset) =>
|
||||
self.view_dialog_help(*offset).boxed(),
|
||||
Self::Browser(target, browser) =>
|
||||
self.view_dialog_browser(target, browser).boxed(),
|
||||
Self::Options =>
|
||||
self.view_dialog_options().boxed(),
|
||||
Self::Device(index) =>
|
||||
self.view_dialog_device(*index).boxed(),
|
||||
Self::Message(message) =>
|
||||
self.view_dialog_message(message).boxed(),
|
||||
});
|
||||
impl Content<TuiOut> for Dialog {
|
||||
fn content (&self) -> impl Render<TuiOut> + '_ {
|
||||
Some(match self {
|
||||
Self::Menu(_) => self.view_dialog_menu().boxed(),
|
||||
_ => "kyp".boxed()
|
||||
})
|
||||
//Self::Help(offset) =>
|
||||
//self.view_dialog_help(*offset).boxed(),
|
||||
//Self::Browser(target, browser) =>
|
||||
//self.view_dialog_browser(target, browser).boxed(),
|
||||
//Self::Options =>
|
||||
//self.view_dialog_options().boxed(),
|
||||
//Self::Device(index) =>
|
||||
//self.view_dialog_device(*index).boxed(),
|
||||
//Self::Message(message) =>
|
||||
//self.view_dialog_message(message).boxed(),
|
||||
//})
|
||||
}
|
||||
}
|
||||
|
||||
content!(TuiOut: |self: Message| match self {
|
||||
Self::FailedToAddDevice => "Failed to add device."
|
||||
|
|
@ -25,7 +30,7 @@ impl Dialog {
|
|||
let option = |a,i|Tui::fg(Rgb(255,255,255), format!("{}", a));
|
||||
Bsp::s(Tui::bold(true, "tek!"), Bsp::s("", Map::south(1, options, option)))
|
||||
}
|
||||
pub fn view_dialog_help <'a> (&'a self, offset: usize) -> impl Content<TuiOut> + use<'a> {
|
||||
pub fn view_dialog_help <'a> (&'a self, offset: usize) -> impl Content<TuiOut> + 'a {
|
||||
Bsp::s(Tui::bold(true, "Help"), "FIXME")
|
||||
//Bsp::s(Tui::bold(true, "Help"), Bsp::s("", Map::south(1,
|
||||
//move||self.config.keys.layers.iter()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue