aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--cocoa/PlatCocoa.mm21
-rw-r--r--doc/ScintillaHistory.html5
2 files changed, 17 insertions, 9 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm
index 7f26f4bb0..50e42f38e 100644
--- a/cocoa/PlatCocoa.mm
+++ b/cocoa/PlatCocoa.mm
@@ -1986,6 +1986,11 @@ void ListBoxImpl::Create(Window & /*parent*/, int /*ctrlID*/, Scintilla::Point p
table.target = ds;
table.doubleAction = @selector(doubleClick:);
table.selectionHighlightStyle = NSTableViewSelectionHighlightStyleSourceList;
+
+ if (@available(macOS 11.0, *)) {
+ [table setStyle: NSTableViewStylePlain];
+ }
+
wid = (__bridge_retained WindowID)winLB;
}
@@ -2016,8 +2021,13 @@ PRectangle ListBoxImpl::GetDesiredRect() {
PRectangle rcDesired;
rcDesired = GetPosition();
- // There appears to be an extra pixel above and below the row contents
- CGFloat itemHeight = table.rowHeight + 2;
+ CGFloat itemHeight;
+ if (@available(macOS 11.0, *)) {
+ itemHeight = table.rowHeight;
+ } else {
+ // There appears to be an extra pixel above and below the row contents
+ itemHeight = table.rowHeight + 2;
+ }
int rows = Length();
if ((rows == 0) || (rows > desiredVisibleRows))
@@ -2027,13 +2037,6 @@ 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 extra 22 pixels fixes it for almost all tested cases.
- rcDesired.right += 22;
- }
-
if (Length() > rows) {
[scroller setHasVerticalScroller: YES];
rcDesired.right += [NSScroller scrollerWidthForControlSize: NSControlSizeRegular
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 5ced2dd86..b01c7f2ae 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -579,6 +579,11 @@
Released 9 April 2021.
</li>
<li>
+ On Cocoa with macOS 11, use plain style for autocompletion to fix problems with truncating text
+ and padding. This makes autocompletion look the same on macOS 11 as macOS 10.
+ <a href="https://sourceforge.net/p/scintilla/bugs/2248/">Bug #2248</a>.
+ </li>
+ <li>
On Windows, fix encoding used for text display with DirectWrite.
<a href="https://sourceforge.net/p/scintilla/bugs/2246/">Bug #2246</a>.
</li>