diff options
| author | Jasper van de Gronde <jasper.vandegronde@gmail.com> | 2010-09-06 17:32:05 +0000 |
|---|---|---|
| committer | Jasper van de Gronde <th.v.d.gronde@hccnet.nl> | 2010-09-06 17:32:05 +0000 |
| commit | be519f62404daf6dff2449a2eb5280d998298868 (patch) | |
| tree | 0512806eccbf0707bc63716be91e5223b48072bb /src/widgets/button.cpp | |
| parent | Extensions. Consistency fix and UI improvements (Generate from path submenu). (diff) | |
| download | inkscape-be519f62404daf6dff2449a2eb5280d998298868.tar.gz inkscape-be519f62404daf6dff2449a2eb5280d998298868.zip | |
Automatically add shortcuts to tooltips
(bzr r9745)
Diffstat (limited to 'src/widgets/button.cpp')
| -rw-r--r-- | src/widgets/button.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/widgets/button.cpp b/src/widgets/button.cpp index 6769fa389..aa32a9d91 100644 --- a/src/widgets/button.cpp +++ b/src/widgets/button.cpp @@ -27,6 +27,8 @@ #include "shortcuts.h" #include "interface.h" +#include <gdk/gdkkeysyms.h> + #include "icon.h" #include "button.h" @@ -291,15 +293,15 @@ sp_button_set_composed_tooltip (GtkTooltips *tooltips, GtkWidget *widget, SPActi { if (action) { unsigned int shortcut = sp_shortcut_get_primary (action->verb); - if (shortcut) { + if (shortcut!=GDK_VoidSymbol) { // there's both action and shortcut - gchar key[256]; - sp_ui_shortcut_string (shortcut, key); + gchar* key = sp_shortcut_get_label(shortcut); gchar *tip = g_strdup_printf ("%s (%s)", action->tip, key); gtk_tooltips_set_tip (tooltips, widget, tip, NULL); g_free (tip); + g_free (key); } else { // action has no shortcut |
