From c10e83b937328313e82070f5714eea0337758a1e Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Fri, 6 Feb 2015 13:01:44 +0100 Subject: [PATCH] Take heed of mnemonic indicator when clipping menu texts An underscore in the menu text should not be counted when deciding where to clip the text to make the menu bar fit the window width. If clipping would occur immediately after an underscore, just clip off the first character to get the mnemonic back in view. (This makes _n from the Engine menu.) --- gtk/xoptions.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/gtk/xoptions.c b/gtk/xoptions.c index 8c5bd26..48da90b 100644 --- a/gtk/xoptions.c +++ b/gtk/xoptions.c @@ -1568,7 +1568,11 @@ if(appData.debugMode) printf("n=%d, h=%d, w=%d\n",n,height,width); top--; msg = _(option[i].name); // write name on the menu button #ifndef OSXAPP - if(tinyLayout) { strcpy(def, msg); def[tinyLayout] = NULLCHAR; msg = def; } // clip menu text to keep menu bar small + if(tinyLayout) { // clip menu text to keep menu bar small + int clip = tinyLayout + 1; + strcpy(def, msg + (msg[clip-1] == '_')); + def[clip] = NULLCHAR; msg = def; + } #endif // XtSetArg(args[j], XtNmenuName, XtNewString(option[i].name)); j++; // XtSetArg(args[j], XtNlabel, msg); j++; -- 1.7.0.4