From 4396c0792015c648c0cfe1fd1bb1c96fad3590f2 Mon Sep 17 00:00:00 2001 From: Ruben Schmidmeister <4602612+bash@users.noreply.github.com> Date: Mon, 13 Feb 2023 22:06:44 +0100 Subject: [PATCH] Use cancel button to reject receive request --- src/receive.rs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/receive.rs b/src/receive.rs index 88e7927..68dd161 100644 --- a/src/receive.rs +++ b/src/receive.rs @@ -195,6 +195,10 @@ fn show_connected_page( ui: &mut Ui, receive_request: &ReceiveRequestController, ) -> Option { + 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(), @@ -202,15 +206,6 @@ fn show_connected_page( ); 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()