diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-03-19 19:56:15 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-03-19 19:56:15 +0100 |
commit | 1542c122b3672fe83e027411ad2445772e2d0ed3 (patch) | |
tree | e535bc621bd7ffa9d5ce89e0d495df5d1c4ab6fd /app/wlib/gtklib/menu.c | |
parent | 773810e6583142d7d15263e6481c42aebed6d7f1 (diff) | |
parent | d1a8285f818eb7e5c3d6a05709ea21a808490b8c (diff) |
Update upstream source from tag 'upstream/5.1.0'
Update to upstream version '5.1.0'
with Debian dir 93ca74b8b4602fce4c9c7740e0cfdde25f086673
Diffstat (limited to 'app/wlib/gtklib/menu.c')
-rw-r--r-- | app/wlib/gtklib/menu.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/app/wlib/gtklib/menu.c b/app/wlib/gtklib/menu.c index fb115a3..d19805a 100644 --- a/app/wlib/gtklib/menu.c +++ b/app/wlib/gtklib/menu.c @@ -32,6 +32,7 @@ #include <gtk/gtk.h> #include <gdk/gdk.h> +#include <gdk/gdkkeysyms.h> #include "gtkint.h" #include "i18n.h" @@ -237,7 +238,14 @@ static wMenuItem_p createMenuItem( return mi; } - +/** + * Add a accelerator key to a widget + * + * @param w IN unused(?) + * @param menu IN unused(?) + * @param menu_item IN owning widget + * @param acclKey IN the accelerator key + */ static void setAcclKey( wWin_p w, GtkWidget * menu, GtkWidget * menu_item, int acclKey ) { int mask; @@ -262,19 +270,12 @@ static void setAcclKey( wWin_p w, GtkWidget * menu, GtkWidget * menu_item, int a mask = 0; if (acclKey) { - int len; - char acclStr[40]; - len = 0; if (acclKey&WALT) { mask |= GDK_MOD1_MASK; - strcpy( acclStr+len, "Meta+" ); - len += 5; } if (acclKey&WSHIFT) { mask |= GDK_SHIFT_MASK; - strcpy( acclStr+len, "Shift+" ); - len += 6; switch ( (acclKey&0xFF) ) { case '0': acclKey += ')'-'0'; break; case '1': acclKey += '!'-'1'; break; @@ -302,11 +303,7 @@ static void setAcclKey( wWin_p w, GtkWidget * menu, GtkWidget * menu_item, int a } if (acclKey&WCTL) { mask |= GDK_CONTROL_MASK; - strcpy( acclStr+len, "Ctrl+" ); - len += 5; } - acclStr[len++] = (acclKey & 0xFF); - acclStr[len++] = '\0'; gtk_widget_add_accelerator( menu_item, "activate", (isalpha(acclKey&0xFF)?accel_alpha_group:accel_nonalpha_group), toupper(acclKey&0xFF), mask, GTK_ACCEL_VISIBLE|GTK_ACCEL_LOCKED ); |