Draw wxTextCtrl focus ring natively on Mac

NSTextView doesn't display focus ring by default, which is why wxOSX
did draw it manually, but this behavior can be overriden since OS X
10.3 with NSView.focusRingType property.

The HITheme-based rendering suffered from a number of non-nativeness
issues:
- didn't respect macOS 10.14+ accent colors
- not animated as the native focus ring
- subtly different shape of the outline
- noticeably different outline shape on macOS 11

Remove NeedsFocusRect() and associated workaround for manually drawing
focus ring inside NSTextView (i.e. multiline text controls). This
private interface was only used for wxTextCtrl and nothing else, so
this shouldn't have any impact elsewhere.
This commit is contained in:
Václav Slavík
2020-08-27 18:12:18 +02:00
parent 9e68df224f
commit 58c94d9ec0
7 changed files with 10 additions and 35 deletions

View File

@@ -111,6 +111,8 @@ public :
virtual void SetNeedsDisplay( const wxRect* where = NULL ) wxOVERRIDE;
virtual bool GetNeedsDisplay() const wxOVERRIDE;
virtual void EnableFocusRing(bool enabled) wxOVERRIDE;
virtual void SetDrawingEnabled(bool enabled) wxOVERRIDE;
virtual bool CanFocus() const wxOVERRIDE;