diff options
author | Neil Hodgson <nyamatongwe@gmail.com> | 2021-02-07 10:19:03 +1100 |
---|---|---|
committer | Neil Hodgson <nyamatongwe@gmail.com> | 2021-02-07 10:19:03 +1100 |
commit | afef7b27d25b91bb3e446446b91519bcc3770876 (patch) | |
tree | 5c1a4737678eaa1380471c8248533ca4e22b3a78 | |
parent | eb7a8f0408a0b3f1e6ecf5f90b20ada206cf9f06 (diff) | |
download | scintilla-mirror-afef7b27d25b91bb3e446446b91519bcc3770876.tar.gz |
On macOS 11, autocompletion list text was being truncated. An extra 22 pixels
was added to the width just on macOS 11.
Its likely that there is a better way to discover the additional width needed.
-rw-r--r-- | cocoa/PlatCocoa.mm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index da30ac4f4..f30bc93e4 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -1782,6 +1782,13 @@ PRectangle ListBoxImpl::GetDesiredRect() { rcDesired.right = rcDesired.left + maxItemWidth + aveCharWidth; rcDesired.right += 4; // Ensures no truncation of text + if (@available(macOS 11, *)) { + // macOS 11 requires some extra space possibly due to the rounded highlight. + // There may be a better way to discover how much space is required + // but an 22 pixels fixes it for almost all tested cases. + rcDesired.right += 22; + } + if (Length() > rows) { [scroller setHasVerticalScroller: YES]; rcDesired.right += [NSScroller scrollerWidthForControlSize: NSControlSizeRegular |