From 59d48a1070e4efc48f8efb134d7a93e3c80b2614 Mon Sep 17 00:00:00 2001 From: Salem Yaslem Date: Mon, 8 Feb 2021 03:13:30 +0300 Subject: [PATCH] remove unnecessary brackets --- src/main.rs | 72 +++++++++++++++++++++++------------------------------ 1 file changed, 31 insertions(+), 41 deletions(-) diff --git a/src/main.rs b/src/main.rs index e345525..278355a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -180,57 +180,47 @@ fn main() { .parse::() .unwrap(), ); - { - let _frames_spin = frames_spin.to_owned(); - frames_spin.connect_value_changed(move |_| { - config_management::set( - "default", - "frame", - _frames_spin.get_value().to_string().as_str(), - ); - }); - } - { - let _delay_spin = delay_spin.to_owned(); - delay_spin.connect_value_changed(move |_| { - config_management::set( - "default", - "delay", - _delay_spin.get_value().to_string().as_str(), - ); - }); - } + let _frames_spin = frames_spin.to_owned(); + frames_spin.connect_value_changed(move |_| { + config_management::set( + "default", + "frame", + _frames_spin.get_value().to_string().as_str(), + ); + }); + let _delay_spin = delay_spin.to_owned(); + delay_spin.connect_value_changed(move |_| { + config_management::set( + "default", + "delay", + _delay_spin.get_value().to_string().as_str(), + ); + }); // Other folder_chooser.set_uri(&config_management::get("default", "folder")); // --- connections // show dialog window when about button clicked then hide it after close - { - let about_dialog: AboutDialog = about_dialog.to_owned(); - about_menu_item.connect_activate(move |_| { - about_dialog.run(); - about_dialog.hide(); - }); - } + let _about_dialog: AboutDialog = about_dialog.to_owned(); + about_menu_item.connect_activate(move |_| { + _about_dialog.run(); + _about_dialog.hide(); + }); // Buttons - { - let area_chooser_window = area_chooser_window.to_owned(); - area_grab_button.connect_clicked(move |_| { - area_chooser_window.show(); - }); - } + let _area_chooser_window = area_chooser_window.to_owned(); + area_grab_button.connect_clicked(move |_| { + _area_chooser_window.show(); + }); // Windows // hide area chooser after it deleted. - { - let _area_chooser_window = area_chooser_window.to_owned(); - area_chooser_window.connect_delete_event(move |_, _event: &gdk::Event| { - _area_chooser_window.hide(); - Inhibit(true) - }); - } + let _area_chooser_window = area_chooser_window.to_owned(); + area_chooser_window.connect_delete_event(move |_, _event: &gdk::Event| { + _area_chooser_window.hide(); + Inhibit(true) + }); // close the application when main window destroy main_window.connect_destroy(|_| { @@ -245,7 +235,7 @@ fn main() { gtk::StyleContext::add_provider_for_screen( &gdk::Screen::get_default().unwrap(), &provider, - gtk::STYLE_PROVIDER_PRIORITY_USER, + gtk::STYLE_PROVIDER_PRIORITY_APPLICATION, ); gtk::main();