Skip to content

Commit

Permalink
Add quit keyboard shortcut (#778)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeebok authored Oct 7, 2024
1 parent 36c0976 commit d7fbb4f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ public class Music.Application : Gtk.Application {
public const string ACTION_PREVIOUS = "action-previous";
public const string ACTION_SHUFFLE = "action-shuffle";
public const string ACTION_FIND = "action-find";
public const string ACTION_QUIT = "action-quit";

private const ActionEntry[] ACTION_ENTRIES = {
{ ACTION_PLAY_PAUSE, action_play_pause, null, "false" },
{ ACTION_NEXT, action_next },
{ ACTION_PREVIOUS, action_previous },
{ ACTION_SHUFFLE, action_shuffle },
{ ACTION_FIND, action_find }
{ ACTION_FIND, action_find },
{ ACTION_QUIT, quit }
};

private PlaybackManager? playback_manager = null;
Expand All @@ -43,6 +45,7 @@ public class Music.Application : Gtk.Application {
add_action_entries (ACTION_ENTRIES, this);

set_accels_for_action (ACTION_PREFIX + ACTION_FIND, {"<Ctrl>F"});
set_accels_for_action (ACTION_PREFIX + ACTION_QUIT, {"<Ctrl>Q"});

((SimpleAction) lookup_action (ACTION_PLAY_PAUSE)).set_enabled (false);
((SimpleAction) lookup_action (ACTION_PLAY_PAUSE)).set_state (false);
Expand Down

0 comments on commit d7fbb4f

Please sign in to comment.