From ef8c1f4bc83dbd2ec56c3819b062b5f8d83442ea Mon Sep 17 00:00:00 2001 From: alilie <94517165+alilie@users.noreply.github.com> Date: Mon, 6 Jun 2022 09:19:57 -0700 Subject: [PATCH] Fix AUI Themed Sash (#22491) The adornment doesn't get applied to dark theme. Fixed by using proper theme flag. With this flag the sash follows OS theme and the adornment is drawn. --- src/aui/dockart.cpp | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/aui/dockart.cpp b/src/aui/dockart.cpp index 83784ffdcd..c938456644 100644 --- a/src/aui/dockart.cpp +++ b/src/aui/dockart.cpp @@ -424,25 +424,16 @@ void wxAuiDefaultDockArt::DrawSash(wxDC& dc, wxWindow *window, int orientation, wxUnusedVar(window); wxUnusedVar(orientation); - if ( wxPlatformInfo::Get().CheckOSVersion(10, 14) && wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW).Red() < 128 ) - { - dc.SetPen(*wxTRANSPARENT_PEN); - dc.SetBrush(m_sashBrush); - dc.DrawRectangle(rect.x, rect.y, rect.width, rect.height); - } - else - { - HIRect splitterRect = CGRectMake( rect.x , rect.y , rect.width , rect.height ); - CGContextRef cgContext ; - wxGCDCImpl *impl = (wxGCDCImpl*) dc.GetImpl(); - cgContext = (CGContextRef) impl->GetGraphicsContext()->GetNativeContext() ; + HIRect splitterRect = CGRectMake( rect.x , rect.y , rect.width , rect.height ); + CGContextRef cgContext ; + wxGCDCImpl *impl = (wxGCDCImpl*) dc.GetImpl(); + cgContext = (CGContextRef) impl->GetGraphicsContext()->GetNativeContext() ; - HIThemeSplitterDrawInfo drawInfo ; - drawInfo.version = 0 ; - drawInfo.state = kThemeStateActive ; - drawInfo.adornment = kHIThemeSplitterAdornmentNone ; - HIThemeDrawPaneSplitter( &splitterRect , &drawInfo , cgContext , kHIThemeOrientationNormal ) ; - } + HIThemeSplitterDrawInfo drawInfo ; + drawInfo.version = 0 ; + drawInfo.state = kThemeStateActive ; + drawInfo.adornment = kHIThemeSplitterAdornmentMetal ; + HIThemeDrawPaneSplitter( &splitterRect , &drawInfo , cgContext , kHIThemeOrientationNormal ) ; #elif defined(__WXGTK__) // clear out the rectangle first