From ff97dfe729c906fb9917138b29fd40fd6f580209 Mon Sep 17 00:00:00 2001 From: Ricky Kresslein Date: Mon, 30 May 2022 09:28:37 +0300 Subject: Bug #51: Dialogs stay on top --- src/ui/task_details.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/ui/task_details.rs') diff --git a/src/ui/task_details.rs b/src/ui/task_details.rs index b44e857..626d976 100755 --- a/src/ui/task_details.rs +++ b/src/ui/task_details.rs @@ -165,7 +165,7 @@ impl FurTaskDetails { start.connect_clicked(clone!(@weak self as this => move |_|{ let window = FurtheranceWindow::default(); let dialog = gtk::MessageDialog::new( - Some(&window), + Some(&this), gtk::DialogFlags::MODAL, gtk::MessageType::Question, gtk::ButtonsType::OkCancel, @@ -250,7 +250,7 @@ impl FurTaskDetails { @strong task, @strong dialog, @weak this => move |_| { let delete_confirmation = gtk::MessageDialog::with_markup( - Some(&window), + Some(&dialog), gtk::DialogFlags::MODAL, gtk::MessageType::Question, gtk::ButtonsType::OkCancel, @@ -490,10 +490,8 @@ impl FurTaskDetails { // Change all task names at once imp.edit_task_names_btn.connect_clicked(clone!(@weak self as this => move|_| { - let window = FurtheranceWindow::default(); - let dialog = gtk::MessageDialog::new( - Some(&window), + Some(&this), gtk::DialogFlags::MODAL, gtk::MessageType::Question, gtk::ButtonsType::OkCancel, @@ -511,6 +509,7 @@ impl FurTaskDetails { message_area.append(&cant_be_empty); dialog.connect_response(move |dialog, resp| { + let window = FurtheranceWindow::default(); cant_be_empty.hide(); if resp == gtk::ResponseType::Ok { let new_name_text = new_name_entry.text(); @@ -561,7 +560,7 @@ impl FurTaskDetails { imp.delete_all_btn.connect_clicked(clone!(@weak self as this => move |_|{ let dialog = gtk::MessageDialog::with_markup( - Some(&window), + Some(&this), gtk::DialogFlags::MODAL, gtk::MessageType::Warning, gtk::ButtonsType::None, -- cgit 1.4.1