[devhelp] app: take back the accelerators



commit a2d49700e6e965840f6f6cbd6c96107792b95a62
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Fri Feb 1 17:40:01 2013 +0100

    app: take back the accelerators

 src/dh-app.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/src/dh-app.c b/src/dh-app.c
index 549b899..a882154 100644
--- a/src/dh-app.c
+++ b/src/dh-app.c
@@ -272,6 +272,20 @@ setup_actions (DhApp *self)
 /******************************************************************************/
 
 static void
+setup_accelerators (DhApp *self)
+{
+        gtk_application_add_accelerator (GTK_APPLICATION (self), "<Primary>0",     "win.zoom-default", NULL);
+        gtk_application_add_accelerator (GTK_APPLICATION (self), "<Primary>minus", "win.zoom-out",     NULL);
+        gtk_application_add_accelerator (GTK_APPLICATION (self), "<Primary>plus",  "win.zoom-in",      NULL);
+        gtk_application_add_accelerator (GTK_APPLICATION (self), "<Primary>f",     "win.find",         NULL);
+        gtk_application_add_accelerator (GTK_APPLICATION (self), "<Primary>c",     "win.copy",         NULL);
+        gtk_application_add_accelerator (GTK_APPLICATION (self), "<Primary>p",     "win.print",        NULL);
+        gtk_application_add_accelerator (GTK_APPLICATION (self), "<Primary>t",     "win.new-tab",      NULL);
+}
+
+/******************************************************************************/
+
+static void
 setup_menu (DhApp *self)
 {
         GtkBuilder *builder;
@@ -305,6 +319,9 @@ startup (GApplication *application)
         /* Setup menu */
         setup_menu (self);
 
+        /* Setup accelerators */
+        setup_accelerators (self);
+
         /* Load the book manager */
         g_assert (self->priv->book_manager == NULL);
         self->priv->book_manager = dh_book_manager_new ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]