From 61fef51fe53e08e8b8000d0336586b649770fe45 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 22 Sep 2018 06:51:01 +0000 Subject: Fix [8229232472]: Cascade menu entry indicator wrong colour on Unix. Patch provided by cjmcdonald. --- unix/tkUnixMenu.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/unix/tkUnixMenu.c b/unix/tkUnixMenu.c index bc1bd2e..0c00dbb 100644 --- a/unix/tkUnixMenu.c +++ b/unix/tkUnixMenu.c @@ -52,8 +52,8 @@ static void SetHelpMenu(TkMenu *menuPtr); static void DrawMenuEntryAccelerator(TkMenu *menuPtr, TkMenuEntry *mePtr, Drawable d, GC gc, Tk_Font tkfont, const Tk_FontMetrics *fmPtr, - Tk_3DBorder activeBorder, int x, int y, - int width, int height, int drawArrow); + Tk_3DBorder activeBorder, Tk_3DBorder bgBorder, + int x, int y, int width, int height, int drawArrow); static void DrawMenuEntryBackground(TkMenu *menuPtr, TkMenuEntry *mePtr, Drawable d, Tk_3DBorder activeBorder, Tk_3DBorder bgBorder, @@ -481,6 +481,7 @@ DrawMenuEntryAccelerator( Tk_Font tkfont, /* The precalculated font */ const Tk_FontMetrics *fmPtr,/* The precalculated metrics */ Tk_3DBorder activeBorder, /* The border for an active item */ + Tk_3DBorder bgBorder, /* The background border */ int x, /* Left coordinate of entry rect */ int y, /* Top coordinate of entry rect */ int width, /* Width of entry */ @@ -510,8 +511,9 @@ DrawMenuEntryAccelerator( points[1].y = points[0].y + CASCADE_ARROW_HEIGHT; points[2].x = points[0].x + CASCADE_ARROW_WIDTH; points[2].y = points[0].y + CASCADE_ARROW_HEIGHT/2; - Tk_Fill3DPolygon(menuPtr->tkwin, d, activeBorder, points, 3, - DECORATION_BORDER_WIDTH, + Tk_Fill3DPolygon(menuPtr->tkwin, d, + (mePtr->state == ENTRY_ACTIVE) ? activeBorder : bgBorder, + points, 3, DECORATION_BORDER_WIDTH, (menuPtr->postedCascade == mePtr) ? TK_RELIEF_SUNKEN : TK_RELIEF_RAISED); } else if (mePtr->accelPtr != NULL) { @@ -1435,7 +1437,8 @@ TkpDrawMenuEntry( DrawMenuEntryLabel(menuPtr, mePtr, d, gc, tkfont, fmPtr, x, adjustedY, width, adjustedHeight); DrawMenuEntryAccelerator(menuPtr, mePtr, d, gc, tkfont, fmPtr, - activeBorder, x, adjustedY, width, adjustedHeight, drawArrow); + activeBorder, bgBorder, x, adjustedY, width, adjustedHeight, + drawArrow); if (!mePtr->hideMargin) { if (mePtr->state == ENTRY_ACTIVE) { bgBorder = activeBorder; -- cgit v0.12 From beecae91bf3fc660e78c836cb4354cf5244b41f3 Mon Sep 17 00:00:00 2001 From: fvogel Date: Sat, 22 Sep 2018 13:11:21 +0000 Subject: Remove somewhat misleading text in comments --- macosx/tkMacOSXMenu.c | 3 +-- unix/tkUnixMenu.c | 3 +-- win/tkWinMenu.c | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/macosx/tkMacOSXMenu.c b/macosx/tkMacOSXMenu.c index 404f625..08f2f72 100644 --- a/macosx/tkMacOSXMenu.c +++ b/macosx/tkMacOSXMenu.c @@ -1625,8 +1625,7 @@ TkpDrawMenuEntry( int height, /* Height of the current rectangle */ int strictMotif, /* Boolean flag */ int drawArrow) /* Whether or not to draw the cascade arrow - * for cascade items. Only applies to - * Windows. */ + * for cascade items. */ { } diff --git a/unix/tkUnixMenu.c b/unix/tkUnixMenu.c index 0c00dbb..2d02097 100644 --- a/unix/tkUnixMenu.c +++ b/unix/tkUnixMenu.c @@ -1328,8 +1328,7 @@ TkpDrawMenuEntry( int height, /* Height of the current rectangle */ int strictMotif, /* Boolean flag */ int drawArrow) /* Whether or not to draw the cascade arrow - * for cascade items. Only applies to - * Windows. */ + * for cascade items. */ { GC gc, indicatorGC; XColor *indicatorColor, *disableColor = NULL; diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 5dc8f8a..1051250 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -1840,7 +1840,7 @@ DrawMenuEntryArrow( int width, /* Width of menu entry */ int height, /* Height of menu entry */ int drawArrow) /* For cascade menus, whether of not to draw - * the arraw. I cannot figure out Windows' + * the arrow. I cannot figure out Windows' * algorithm for where to draw this. */ { COLORREF oldFgColor; @@ -2500,7 +2500,7 @@ TkpDrawMenuEntry( int strictMotif, /* Boolean flag */ int drawingParameters) /* Whether or not to draw the cascade arrow * for cascade items and accelerator - * cues. Only applies to Windows. */ + * cues. */ { GC gc, indicatorGC; TkMenu *menuPtr = mePtr->menuPtr; -- cgit v0.12