Skip to content

Commit

Permalink
Quit the application on Ctrl+Q, as requested in issue #181
Browse files Browse the repository at this point in the history
  • Loading branch information
marin-m committed Sep 29, 2024
1 parent f502a31 commit d36445f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/gui/main_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -931,8 +931,14 @@ pub fn gui_main(recording: bool, input_file: Option<&str>, enable_mpris_cli: boo
microphone_stop_button.hide();
current_volume_hbox.hide();

let quit = gio::SimpleAction::new("quit", None);
quit.connect_activate(glib::clone!(@weak application => move |_,_| {
application.quit();
}));
application.set_accels_for_action("app.quit", &["<Primary>Q"]);
application.add_action(&quit);

});


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

0 comments on commit d36445f

Please sign in to comment.