[sysprof/wip/visualizers] app: add accels for zoom actions



commit bd008c0826a54878616d8dc86ae804c0311e1ae9
Author: Christian Hergert <chergert redhat com>
Date:   Fri Sep 30 13:29:09 2016 -0700

    app: add accels for zoom actions
    
    Adds ctrl++, ctrl+-, and ctrl+0 for typical zoom operations on
    the visualizers.

 src/sp-application.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/sp-application.c b/src/sp-application.c
index 1363e6d..0530352 100644
--- a/src/sp-application.c
+++ b/src/sp-application.c
@@ -259,9 +259,16 @@ sp_application_init (SpApplication *self)
     { "help",         sysprof_help },
     { "quit",         sysprof_quit },
   };
+  static const gchar *zoom_in_accels[] = { "<control>plus", NULL };
+  static const gchar *zoom_out_accels[] = { "<control>minus", NULL };
+  static const gchar *zoom_one_accels[] = { "<control>0", NULL };
 
   g_action_map_add_action_entries (G_ACTION_MAP (self), actions, G_N_ELEMENTS (actions), self);
 
+  gtk_application_set_accels_for_action (GTK_APPLICATION (self), "zoom.zoom-in", zoom_in_accels);
+  gtk_application_set_accels_for_action (GTK_APPLICATION (self), "zoom.zoom-out", zoom_out_accels);
+  gtk_application_set_accels_for_action (GTK_APPLICATION (self), "zoom.zoom-one", zoom_one_accels);
+
   g_application_set_default (G_APPLICATION (self));
 }
 


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