Skip to content

Commit

Permalink
Fix [844c0be72d]: Menu entry underline does not consider activeborder…
Browse files Browse the repository at this point in the history
…width.
  • Loading branch information
fvogelnew1 committed Dec 17, 2024
2 parents 6c2e185 + abd1029 commit 287b553
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Release Tk 9.0.1 arises from the check-in with tag `core-9-0-1`.
- [TIP #706: Expose three Tk "In Context" functions via stubs table](https://core.tcl-lang.org/tips/doc/trunk/tip/706.md)
- [Bind mechanism vs. GNOME](https://core.tcl-lang.org/tk/tktview/6bdf1a)
- [many PIXEL options don't keep their configured value](https://core.tcl-lang.org/tk/tktview/29ba53)
- [Menu entry underline does not consider activeborderwidth](https://core.tcl-lang.org/tk/tktview/844c0b)

Release Tk 9.0.0 arises from the check-in with tag `core-9-0-0`.

Expand Down
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 = Tcl_GetCharLength(mePtr->labelPtr);
if (mePtr->underline < len) {
const char *label, *start, *end;
int ch;
int activeBorderWidth, ch;

label = Tcl_GetString(mePtr->labelPtr);
start = Tcl_UtfAtIndex(label, mePtr->underline);
end = start + Tcl_UtfToUniChar(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 287b553

Please sign in to comment.