Skip to content

Commit

Permalink
feat(ui_window, about): add ? hotkey for showing help window
Browse files Browse the repository at this point in the history
  • Loading branch information
actionless committed Sep 1, 2024
1 parent 26bfe3a commit 22cfc6d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ See the output of `geh --help` for detals.
* `-`, zoom out current image.
* `0`, zoom current image to original size.
* `F11`, toggle fullscreen mode.
* `?`, show help window.

1 change: 1 addition & 0 deletions src/about.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,6 @@ gchar * get_key_bindings_message(void)
"-, zoom out current image.\n"
"0, zoom current image to original size.\n"
"F11, toggle fullscreen mode.\n"
"?, show this help.\n"
);
}
6 changes: 6 additions & 0 deletions src/ui_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,12 @@ callback_key_press (GtkWidget *widget, GdkEventKey *key, gpointer data)
}
ui->is_fullscreen = ui->is_fullscreen == TRUE ? FALSE : TRUE;
break;
case GDK_KEY_question:
gchar * message = get_key_bindings_message ();
GtkWidget * about_dialog = create_info_window (GTK_WINDOW (ui->window), "Key Bindings", message);
gtk_widget_show (about_dialog);
g_free(message);
break;
default:
return FALSE;
break;
Expand Down

0 comments on commit 22cfc6d

Please sign in to comment.