From df99760d0f789b808d67900207ebef83d02211d4 Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 10 Dec 2024 20:47:44 +0200 Subject: [PATCH] reorder asc --- .../tab/item/page/content/status/download.rs | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/app/browser/window/tab/item/page/content/status/download.rs b/src/app/browser/window/tab/item/page/content/status/download.rs index a05ea062..f50fe6f1 100644 --- a/src/app/browser/window/tab/item/page/content/status/download.rs +++ b/src/app/browser/window/tab/item/page/content/status/download.rs @@ -31,11 +31,11 @@ pub fn new( let dialog = FileDialog::builder().initial_name(initial_filename).build(); let file_launcher = FileLauncher::new(File::NONE); + let cancel = Rc::new(Cancel::new()); + let choose = Rc::new(Choose::new()); + let open = Rc::new(Open::new()); let progress = Rc::new(Progress::new()); let status = Rc::new(Status::new()); - let cancel = Rc::new(Cancel::new()); - let open = Rc::new(Open::new()); - let choose = Rc::new(Choose::new()); // Init events cancel.on_activate({ @@ -59,26 +59,6 @@ pub fn new( } }); - open.on_activate({ - let cancellable = cancellable.clone(); - let file_launcher = file_launcher.clone(); - let status = status.clone(); - move |_, button| { - button.set_sensitive(false); // lock - file_launcher.launch(Window::NONE, Some(&cancellable), { - let status = status.clone(); - let button = button.clone(); - move |result| { - if let Err(ref e) = result { - status.label.set_css_classes(&["error"]); - status.label.set_label(e.message()) - } - button.set_sensitive(true); // unlock - } - }) - } - }); - choose.on_activate({ // init shared references let cancellable = cancellable.clone(); @@ -141,6 +121,26 @@ pub fn new( } }); + open.on_activate({ + let cancellable = cancellable.clone(); + let file_launcher = file_launcher.clone(); + let status = status.clone(); + move |_, button| { + button.set_sensitive(false); // lock + file_launcher.launch(Window::NONE, Some(&cancellable), { + let status = status.clone(); + let button = button.clone(); + move |result| { + if let Err(ref e) = result { + status.label.set_css_classes(&["error"]); + status.label.set_label(e.message()) + } + button.set_sensitive(true); // unlock + } + }) + } + }); + // Init `child` as the container for extra features let child = Box::builder().orientation(Orientation::Vertical).build();