Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui_window, about): add ? hotkey for showing help window #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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