Skip to content

Commit d36445f

Browse files
committed
Quit the application on Ctrl+Q, as requested in issue #181
1 parent f502a31 commit d36445f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/gui/main_window.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -931,8 +931,14 @@ pub fn gui_main(recording: bool, input_file: Option<&str>, enable_mpris_cli: boo
931931
microphone_stop_button.hide();
932932
current_volume_hbox.hide();
933933

934+
let quit = gio::SimpleAction::new("quit", None);
935+
quit.connect_activate(glib::clone!(@weak application => move |_,_| {
936+
application.quit();
937+
}));
938+
application.set_accels_for_action("app.quit", &["<Primary>Q"]);
939+
application.add_action(&quit);
940+
934941
});
935-
936942

937943
application.connect_activate(move |application| {
938944
let main_window = &application.get_windows()[0];

0 commit comments

Comments
 (0)