better error popup
This commit is contained in:
parent
b281f8af00
commit
0afc497f78
|
@ -9,6 +9,7 @@ crate_type = "bin"
|
|||
|
||||
[dependencies]
|
||||
dirs = "^3.0.1"
|
||||
gdk = "^0.13.2"
|
||||
gio = "^0"
|
||||
gtk = "^0"
|
||||
rodio = "^0.11.0"
|
||||
|
|
14
src/main.rs
14
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 {
|
||||
|
|
Loading…
Reference in New Issue