Allow configuring visible focus on Mac
Add wxWindow::EnableVisibleFocus() for changing focus ring behavior on macOS (currently not implemented elsewhere, although GTK+ has a discouraged option to do it).
This commit is contained in:
@@ -157,6 +157,7 @@ public:
|
|||||||
void MacOnScroll( wxScrollEvent&event );
|
void MacOnScroll( wxScrollEvent&event );
|
||||||
|
|
||||||
virtual bool AcceptsFocus() const wxOVERRIDE;
|
virtual bool AcceptsFocus() const wxOVERRIDE;
|
||||||
|
virtual void EnableVisibleFocus(bool enabled) wxOVERRIDE;
|
||||||
|
|
||||||
virtual bool IsDoubleBuffered() const wxOVERRIDE { return true; }
|
virtual bool IsDoubleBuffered() const wxOVERRIDE { return true; }
|
||||||
|
|
||||||
|
@@ -767,6 +767,9 @@ public:
|
|||||||
// call this when the return value of AcceptsFocus() changes
|
// call this when the return value of AcceptsFocus() changes
|
||||||
virtual void SetCanFocus(bool WXUNUSED(canFocus)) { }
|
virtual void SetCanFocus(bool WXUNUSED(canFocus)) { }
|
||||||
|
|
||||||
|
// call to customize visible focus indicator if possible in the port
|
||||||
|
virtual void EnableVisibleFocus(bool WXUNUSED(enabled)) { }
|
||||||
|
|
||||||
// navigates inside this window
|
// navigates inside this window
|
||||||
bool NavigateIn(int flags = wxNavigationKeyEvent::IsForward)
|
bool NavigateIn(int flags = wxNavigationKeyEvent::IsForward)
|
||||||
{ return DoNavigateIn(flags); }
|
{ return DoNavigateIn(flags); }
|
||||||
|
@@ -540,6 +540,22 @@ public:
|
|||||||
*/
|
*/
|
||||||
virtual void SetCanFocus(bool canFocus);
|
virtual void SetCanFocus(bool canFocus);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Enables or disables visible indication of keyboard focus.
|
||||||
|
|
||||||
|
By default, controls behave in platform-appropriate way and show focus
|
||||||
|
in the same way native applications do. In some very rare circumstances
|
||||||
|
it may be desirable to change the default (notably multiline text
|
||||||
|
controls don't normally have a focus indicator on Mac), which this
|
||||||
|
method allows. It should only be used if you have a good understanding
|
||||||
|
of the native platform's guidelines and user expectations.
|
||||||
|
|
||||||
|
This method is only implemented on Mac.
|
||||||
|
|
||||||
|
@since 3.1.5
|
||||||
|
*/
|
||||||
|
virtual void EnableVisibleFocus(bool enable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This sets the window to receive keyboard input.
|
This sets the window to receive keyboard input.
|
||||||
|
|
||||||
|
@@ -2171,6 +2171,11 @@ bool wxWindowMac::AcceptsFocus() const
|
|||||||
return GetPeer()->CanFocus();
|
return GetPeer()->CanFocus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wxWindowMac::EnableVisibleFocus(bool enabled)
|
||||||
|
{
|
||||||
|
GetPeer()->EnableFocusRing(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
void wxWindowMac::MacSuperChangedPosition()
|
void wxWindowMac::MacSuperChangedPosition()
|
||||||
{
|
{
|
||||||
// only window-absolute structures have to be moved i.e. controls
|
// only window-absolute structures have to be moved i.e. controls
|
||||||
|
Reference in New Issue
Block a user