diff options
| author | Krzysztof Kosi??ski <tweenk.pl@gmail.com> | 2010-11-25 20:51:17 +0000 |
|---|---|---|
| committer | Krzysztof KosiĆski <tweenk.pl@gmail.com> | 2010-11-25 20:51:17 +0000 |
| commit | 0bd9f7e209d522dbcebe0449a91397fdd9e38977 (patch) | |
| tree | 834c7d02456658b57625ab68cc28f7854a5a85dc /src/widgets/button.cpp | |
| parent | Fix handling of x and y attributes of patterns (diff) | |
| parent | Fix ruler redraw issue on GTK 2.22 (diff) | |
| download | inkscape-0bd9f7e209d522dbcebe0449a91397fdd9e38977.tar.gz inkscape-0bd9f7e209d522dbcebe0449a91397fdd9e38977.zip | |
Merge from trunk
(bzr r9508.1.70)
Diffstat (limited to 'src/widgets/button.cpp')
| -rw-r--r-- | src/widgets/button.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/widgets/button.cpp b/src/widgets/button.cpp index 6769fa389..dc830d096 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" @@ -286,29 +288,27 @@ sp_button_action_set_shortcut (SPAction *action, unsigned int /*shortcut*/, void } } -static void -sp_button_set_composed_tooltip (GtkTooltips *tooltips, GtkWidget *widget, SPAction *action) +static void sp_button_set_composed_tooltip(GtkTooltips *tooltips, GtkWidget *widget, SPAction *action) { - if (action) { - unsigned int shortcut = sp_shortcut_get_primary (action->verb); - if (shortcut) { - // there's both action and shortcut - - gchar key[256]; - sp_ui_shortcut_string (shortcut, key); - - gchar *tip = g_strdup_printf ("%s (%s)", action->tip, key); - gtk_tooltips_set_tip (tooltips, widget, tip, NULL); - g_free (tip); - - } else { - // action has no shortcut - gtk_tooltips_set_tip (tooltips, widget, action->tip, NULL); - } - } else { - // no action - gtk_tooltips_set_tip (tooltips, widget, NULL, NULL); - } + if (action) { + unsigned int shortcut = sp_shortcut_get_primary (action->verb); + if (shortcut != GDK_VoidSymbol) { + // there's both action and shortcut + + 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 + gtk_tooltips_set_tip(tooltips, widget, action->tip, NULL); + } + } else { + // no action + gtk_tooltips_set_tip(tooltips, widget, NULL, NULL); + } } GtkWidget * |
