Added accelerators to GcalApplication actions.
This commit is contained in:
committed by
Rene A. Viant Moran
parent
44ddbdbf88
commit
8e0de96520
@@ -175,6 +175,8 @@ gcal_application_set_app_menu (GApplication *app)
|
|||||||
GSimpleAction *about;
|
GSimpleAction *about;
|
||||||
GSimpleAction *quit;
|
GSimpleAction *quit;
|
||||||
|
|
||||||
|
GVariant *va;
|
||||||
|
|
||||||
g_return_if_fail (GCAL_IS_APPLICATION (app));
|
g_return_if_fail (GCAL_IS_APPLICATION (app));
|
||||||
priv = GCAL_APPLICATION (app)->priv;
|
priv = GCAL_APPLICATION (app)->priv;
|
||||||
|
|
||||||
@@ -215,6 +217,16 @@ gcal_application_set_app_menu (GApplication *app)
|
|||||||
g_menu_append (app_menu, _("Quit"), "app.quit");
|
g_menu_append (app_menu, _("Quit"), "app.quit");
|
||||||
|
|
||||||
gtk_application_set_app_menu (GTK_APPLICATION (app), G_MENU_MODEL (app_menu));
|
gtk_application_set_app_menu (GTK_APPLICATION (app), G_MENU_MODEL (app_menu));
|
||||||
|
|
||||||
|
/* Accelerators */
|
||||||
|
gtk_application_add_accelerator (GTK_APPLICATION (app), "<Primary>q", "app.quit", NULL);
|
||||||
|
|
||||||
|
va = g_variant_new_string ("month");
|
||||||
|
gtk_application_add_accelerator (GTK_APPLICATION (app), "<Primary>m", "app.view", va);
|
||||||
|
g_variant_unref (va);
|
||||||
|
va = g_variant_new_string ("year");
|
||||||
|
gtk_application_add_accelerator (GTK_APPLICATION (app), "<Primary>y", "app.view", va);
|
||||||
|
g_variant_unref (va);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
Reference in New Issue
Block a user