Skip to content

Commit

Permalink
Use cancel button to reject receive request
Browse files Browse the repository at this point in the history
  • Loading branch information
bash committed Feb 13, 2023
1 parent 2ba3f49 commit 4396c07
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/receive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,22 +195,17 @@ fn show_connected_page(
ui: &mut Ui,
receive_request: &ReceiveRequestController,
) -> Option<ConnectedPageResponse> {
if cancel_button(ui, CancelLabel::Cancel) {
return Some(ConnectedPageResponse::Reject);
}

let text = format!(
"Your peer wants to send you \"{}\" (Size: {}). Do you want to download this file?",
receive_request.filename().display(),
ByteDisplay(receive_request.filesize().bytes())
);

page_with_content(ui, "Receive File", text, "📥", |ui| {
if ui
.add(Button::new("Reject").min_size(MIN_BUTTON_SIZE))
.clicked()
{
return Some(ConnectedPageResponse::Reject);
}

ui.add_space(5.0);

if ui
.add(Button::new("Accept").min_size(MIN_BUTTON_SIZE))
.clicked()
Expand Down

0 comments on commit 4396c07

Please sign in to comment.