1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 08:27:13 +01:00

Bug 2410 - Mac: Cosmetic issues with undocked resizable toolbars in Dark and High Contrast themes

This commit is contained in:
Leland Lucius
2020-05-29 18:31:35 -05:00
parent d6f8410d56
commit a4b0635dd5

View File

@@ -530,6 +530,12 @@ void ToolBar::ReCreateButtons()
mResizer = NULL; mResizer = NULL;
SetLayoutDirection(wxLayout_LeftToRight); SetLayoutDirection(wxLayout_LeftToRight);
// Refresh the background before populating
if (!IsDocked())
{
GetParent()->Refresh();
}
{ {
// Create the main sizer // Create the main sizer
auto ms = std::make_unique<wxBoxSizer>(wxHORIZONTAL); auto ms = std::make_unique<wxBoxSizer>(wxHORIZONTAL);
@@ -930,26 +936,15 @@ void ToolBar::OnErase( wxEraseEvent & WXUNUSED(event) )
// //
// This draws the background of a toolbar // This draws the background of a toolbar
// //
void ToolBar::OnPaint( wxPaintEvent & event ) void ToolBar::OnPaint( wxPaintEvent & WXUNUSED(event) )
{ {
(void)event;// compiler food.
//wxPaintDC dc( (wxWindow *) event.GetEventObject() );
wxPaintDC dc( this ); wxPaintDC dc( this );
// Start with a clean background
//
// Under GTK, we specifically set the toolbar background to the background
// colour in the system theme.
#if defined( __WXGTK__ )
//dc.SetBackground( wxBrush( wxSystemSettings::GetColour( wxSYS_COLOUR_BACKGROUND ) ) );
#endif
// Themed background colour. // Themed background colour.
dc.SetBackground( wxBrush( theTheme.Colour( clrMedium ) ) ); dc.SetBackground( wxBrush( theTheme.Colour( clrMedium ) ) );
dc.Clear(); dc.Clear();
#ifdef USE_AQUA_THEME
Repaint( &dc ); Repaint( &dc );
#endif
} }
void ToolBar::OnMouseEvents(wxMouseEvent &event) void ToolBar::OnMouseEvents(wxMouseEvent &event)