Skip to content

Commit

Permalink
(cherry-pick): Fix [844c0be72d]: Menu entry underline does not consid…
Browse files Browse the repository at this point in the history
…er activeborderwidth.
  • Loading branch information
jan.nijtmans committed Dec 18, 2024
1 parent bb993ca commit cccd4c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions win/tkWinMenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2107,13 +2107,15 @@ DrawMenuUnderline(
len = TkGetCharLength(mePtr->labelPtr);
if (mePtr->underline < len) {
const char *label, *start, *end;
int ch;
int activeBorderWidth, ch;

label = Tcl_GetString(mePtr->labelPtr);
start = TkUtfAtIndex(label, mePtr->underline);
end = start + TkUtfToUniChar(start, &ch);
Tk_GetPixelsFromObj(NULL, menuPtr->tkwin,
menuPtr->activeBorderWidthPtr, &activeBorderWidth);
Tk_UnderlineChars(menuPtr->display, d,
gc, tkfont, label, x + mePtr->indicatorSpace,
gc, tkfont, label, x + mePtr->indicatorSpace + activeBorderWidth,
y + (height + fmPtr->ascent - fmPtr->descent) / 2,
(int) (start - label), (int) (end - label));
}
Expand Down

0 comments on commit cccd4c7

Please sign in to comment.