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 {
|
pub enum SendingScreen {
|
||||||
Files,
|
Files,
|
||||||
Peers,
|
Peers,
|
||||||
|
Text,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl App {
|
impl App {
|
||||||
|
@ -125,6 +126,7 @@ impl App {
|
||||||
KeyCode::Enter => todo!("send to the selected peer"),
|
KeyCode::Enter => todo!("send to the selected peer"),
|
||||||
_ => {}
|
_ => {}
|
||||||
},
|
},
|
||||||
|
SendingScreen::Text => {}
|
||||||
},
|
},
|
||||||
_ => match key_event.code {
|
_ => match key_event.code {
|
||||||
KeyCode::Char('q') => self.exit(),
|
KeyCode::Char('q') => self.exit(),
|
||||||
|
|
|
@ -71,6 +71,8 @@ static CONTENT_SEND_FILE_MENU: LazyLock<Line> = LazyLock::new(|| {
|
||||||
"<LEFT>".blue().bold(),
|
"<LEFT>".blue().bold(),
|
||||||
" Child Dir ".into(),
|
" Child Dir ".into(),
|
||||||
"<RIGHT>".blue().bold(),
|
"<RIGHT>".blue().bold(),
|
||||||
|
" Enter Text ".into(),
|
||||||
|
"<T>".blue().bold(),
|
||||||
" Peers ".into(),
|
" Peers ".into(),
|
||||||
"<TAB>".blue().bold(),
|
"<TAB>".blue().bold(),
|
||||||
" Previous Screen ".into(),
|
" Previous Screen ".into(),
|
||||||
|
@ -88,6 +90,8 @@ static CONTENT_SEND_PEERS_MENU: LazyLock<Line> = LazyLock::new(|| {
|
||||||
"<DOWN>".blue().bold(),
|
"<DOWN>".blue().bold(),
|
||||||
" Select ".into(),
|
" Select ".into(),
|
||||||
"<ENTER>".blue().bold(),
|
"<ENTER>".blue().bold(),
|
||||||
|
" Enter Text ".into(),
|
||||||
|
"<T>".blue().bold(),
|
||||||
" Files ".into(),
|
" Files ".into(),
|
||||||
"<TAB>".blue().bold(),
|
"<TAB>".blue().bold(),
|
||||||
" Previous Screen ".into(),
|
" Previous Screen ".into(),
|
||||||
|
@ -145,14 +149,24 @@ impl Widget for &mut App {
|
||||||
buf,
|
buf,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
CurrentScreen::Sending(s) => match s {
|
CurrentScreen::Sending(s) => {
|
||||||
|
match s {
|
||||||
SendingScreen::Files => {
|
SendingScreen::Files => {
|
||||||
outer_frame(*current_screen, &CONTENT_SEND_FILE_MENU, area, buf)
|
outer_frame(*current_screen, &CONTENT_SEND_FILE_MENU, area, buf)
|
||||||
}
|
}
|
||||||
SendingScreen::Peers => {
|
SendingScreen::Peers => {
|
||||||
outer_frame(*current_screen, &CONTENT_SEND_PEERS_MENU, area, buf)
|
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);
|
outer_frame(*current_screen, &MAIN_MENU, area, buf);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue