From 0afc497f78b6e61b4cd1599285891895a123397e Mon Sep 17 00:00:00 2001 From: Max Bradbury Date: Sun, 4 Oct 2020 12:28:28 +0100 Subject: [PATCH] better error popup --- Cargo.toml | 1 + src/main.rs | 14 +++----------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 00d7a1a..d1c0e71 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ crate_type = "bin" [dependencies] dirs = "^3.0.1" +gdk = "^0.13.2" gio = "^0" gtk = "^0" rodio = "^0.11.0" diff --git a/src/main.rs b/src/main.rs index 889f123..e774dae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,21 +28,13 @@ fn error_popup(message: &str) { popup.set_border_width(SPACING as u32); popup.set_position(gtk::WindowPosition::Center); popup.set_default_size(256, 64); - - let vertical = gtk::Box::new(Orientation::Vertical, SPACING); - popup.add(&vertical); + popup.set_type_hint(gdk::WindowTypeHint::Dialog); + popup.set_resizable(false); let message = gtk::Label::new(Some(message)); - vertical.add(&message); - - let button_ok = gtk::Button::with_label("OK"); - vertical.add(&button_ok); + popup.add(&message); popup.show_all(); - - button_ok.connect_clicked(move |_| unsafe { - popup.destroy(); - }); } fn get_data_dir() -> PathBuf {