Don't draw focus around AUI tabs under macOS
This currently doesn't work there because the focus rectangle doesn't fit into the space reserved for it (which is a bug on its own, probably) and would look very out of place even if it did work because the native tabs don't use focus rectangle for the selected tab. Closes #22190.
This commit is contained in:
parent
4e885516b9
commit
b5cb056a03
@ -618,7 +618,8 @@ void wxAuiGenericTabArt::DrawTab(wxDC& dc,
|
||||
text_offset,
|
||||
drawn_tab_yoff + (drawn_tab_height)/2 - (texty/2) - 1);
|
||||
|
||||
// draw focus rectangle
|
||||
// draw focus rectangle except under macOS where it looks out of place
|
||||
#ifndef __WXOSX__
|
||||
if (page.active && (wnd->FindFocus() == wnd))
|
||||
{
|
||||
wxRect focusRectText(text_offset, (drawn_tab_yoff + (drawn_tab_height)/2 - (texty/2) - 1),
|
||||
@ -646,6 +647,7 @@ void wxAuiGenericTabArt::DrawTab(wxDC& dc,
|
||||
|
||||
wxRendererNative::Get().DrawFocusRect(wnd, dc, focusRect, 0);
|
||||
}
|
||||
#endif // !__WXOSX__
|
||||
|
||||
*out_tab_rect = wxRect(tab_x, tab_y, tab_width, tab_height);
|
||||
|
||||
@ -1180,7 +1182,8 @@ void wxAuiSimpleTabArt::DrawTab(wxDC& dc,
|
||||
(tab_y + tab_height)/2 - (texty/2) + 1);
|
||||
|
||||
|
||||
// draw focus rectangle
|
||||
// draw focus rectangle except under macOS where it looks out of place
|
||||
#ifndef __WXOSX__
|
||||
if (page.active && (wnd->FindFocus() == wnd))
|
||||
{
|
||||
wxRect focusRect(text_offset, ((tab_y + tab_height)/2 - (texty/2) + 1),
|
||||
@ -1190,6 +1193,7 @@ void wxAuiSimpleTabArt::DrawTab(wxDC& dc,
|
||||
|
||||
wxRendererNative::Get().DrawFocusRect(wnd, dc, focusRect, 0);
|
||||
}
|
||||
#endif // !__WXOSX__
|
||||
|
||||
*out_tab_rect = wxRect(tab_x, tab_y, tab_width, tab_height);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user