add file picker widget display in send screen
This commit is contained in:
parent
b486b33fa5
commit
6d21fa908c
2 changed files with 23 additions and 7 deletions
|
@ -42,6 +42,7 @@ pub enum CurrentScreen {
|
|||
pub enum SendingScreen {
|
||||
Files,
|
||||
Peers,
|
||||
Text,
|
||||
}
|
||||
|
||||
impl App {
|
||||
|
@ -125,6 +126,7 @@ impl App {
|
|||
KeyCode::Enter => todo!("send to the selected peer"),
|
||||
_ => {}
|
||||
},
|
||||
SendingScreen::Text => {}
|
||||
},
|
||||
_ => match key_event.code {
|
||||
KeyCode::Char('q') => self.exit(),
|
||||
|
|
|
@ -71,6 +71,8 @@ static CONTENT_SEND_FILE_MENU: LazyLock<Line> = LazyLock::new(|| {
|
|||
"<LEFT>".blue().bold(),
|
||||
" Child Dir ".into(),
|
||||
"<RIGHT>".blue().bold(),
|
||||
" Enter Text ".into(),
|
||||
"<T>".blue().bold(),
|
||||
" Peers ".into(),
|
||||
"<TAB>".blue().bold(),
|
||||
" Previous Screen ".into(),
|
||||
|
@ -88,6 +90,8 @@ static CONTENT_SEND_PEERS_MENU: LazyLock<Line> = LazyLock::new(|| {
|
|||
"<DOWN>".blue().bold(),
|
||||
" Select ".into(),
|
||||
"<ENTER>".blue().bold(),
|
||||
" Enter Text ".into(),
|
||||
"<T>".blue().bold(),
|
||||
" Files ".into(),
|
||||
"<TAB>".blue().bold(),
|
||||
" Previous Screen ".into(),
|
||||
|
@ -145,14 +149,24 @@ impl Widget for &mut App {
|
|||
buf,
|
||||
);
|
||||
}
|
||||
CurrentScreen::Sending(s) => match s {
|
||||
CurrentScreen::Sending(s) => {
|
||||
match s {
|
||||
SendingScreen::Files => {
|
||||
outer_frame(*current_screen, &CONTENT_SEND_FILE_MENU, area, buf)
|
||||
}
|
||||
SendingScreen::Peers => {
|
||||
outer_frame(*current_screen, &CONTENT_SEND_PEERS_MENU, area, buf)
|
||||
}
|
||||
},
|
||||
SendingScreen::Text => {}
|
||||
}
|
||||
|
||||
let peers = PeersWidget { peers: &self.peers };
|
||||
|
||||
self.file_picker
|
||||
.widget()
|
||||
.render(top.inner(subscreen_margin), buf);
|
||||
peers.render(bottom.inner(subscreen_margin), buf);
|
||||
}
|
||||
_ => {
|
||||
outer_frame(*current_screen, &MAIN_MENU, area, buf);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue