sdgui: fix M-0 going one item beyond our intent

This commit is contained in:
Přemysl Eric Janouch 2021-10-28 21:42:49 +02:00
parent 8c80aa9da2
commit ed26259e6d
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 1 additions and 1 deletions

View File

@ -214,7 +214,7 @@ on_key_press (G_GNUC_UNUSED GtkWidget *widget, GdkEvent *event,
&& event->key.keyval <= GDK_KEY_9) && event->key.keyval <= GDK_KEY_9)
{ {
gint n = event->key.keyval - GDK_KEY_0; gint n = event->key.keyval - GDK_KEY_0;
gtk_notebook_set_current_page (notebook, n ? (n - 1) : 10); gtk_notebook_set_current_page (notebook, (n ? n : 10) - 1);
return TRUE; return TRUE;
} }
} }