Skip to content

Commit

Permalink
Show the keybind for "mute" in the menubar.
Browse files Browse the repository at this point in the history
  • Loading branch information
Arignir committed Oct 8, 2024
1 parent f08460f commit d016fbf
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions source/app/windows/menubar.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ app_win_menubar_emulation(
igSeparator();

bind_str = app_bindings_keyboard_binding_to_str(&app->binds.keyboard[BIND_EMULATOR_PAUSE]);
if (igMenuItem_Bool("Pause", bind_str ?: "", !app->emulation.is_running, app->emulation.is_started)) {
if (igMenuItem_Bool("Pause", bind_str, !app->emulation.is_running, app->emulation.is_started)) {
if (app->emulation.is_running) {
app_emulator_pause(app);
} else {
Expand All @@ -264,13 +264,13 @@ app_win_menubar_emulation(
free(bind_str);

bind_str = app_bindings_keyboard_binding_to_str(&app->binds.keyboard[BIND_EMULATOR_STOP]);
if (igMenuItem_Bool("Stop", bind_str ?: "", false, app->emulation.is_started)) {
if (igMenuItem_Bool("Stop", bind_str, false, app->emulation.is_started)) {
app_emulator_stop(app);
}
free(bind_str);

bind_str = app_bindings_keyboard_binding_to_str(&app->binds.keyboard[BIND_EMULATOR_RESET]);
if (igMenuItem_Bool("Reset", bind_str ?: "", false, app->emulation.is_started)) {
if (igMenuItem_Bool("Reset", bind_str, false, app->emulation.is_started)) {
app_emulator_reset(app);
}
free(bind_str);
Expand Down Expand Up @@ -332,7 +332,7 @@ app_win_menubar_video(

/* Take a screenshot */
bind_str = app_bindings_keyboard_binding_to_str(&app->binds.keyboard[BIND_EMULATOR_SCREENSHOT]);
if (igMenuItem_Bool("Take Screenshot", bind_str ?: "", false, app->emulation.is_started)) {
if (igMenuItem_Bool("Take Screenshot", bind_str, false, app->emulation.is_started)) {
app_emulator_screenshot(app);
}
free(bind_str);
Expand Down Expand Up @@ -397,11 +397,14 @@ void
app_win_menubar_audio(
struct app *app
) {
char *bind_str;

if (igBeginMenu("Audio", true)) {
/* VSync */
if (igMenuItem_Bool("Mute", NULL, app->settings.audio.mute, true)) {
bind_str = app_bindings_keyboard_binding_to_str(&app->binds.keyboard[BIND_EMULATOR_MUTE]);
if (igMenuItem_Bool("Mute", bind_str, app->settings.audio.mute, true)) {
app->settings.audio.mute ^= 1;
}
free(bind_str);

igSeparator();

Expand Down

0 comments on commit d016fbf

Please sign in to comment.