Merge branch 'qt-bgcol-fixes'
Make setting background colour in wxQt more consistent with the other ports and fix it for wxSearchCtrl. Closes #23170, #24315.
This commit is contained in:
commit
47b011c665
3 changed files with 14 additions and 9 deletions
|
|
@ -306,8 +306,8 @@ bool wxSearchCtrl::Create(wxWindow *parent, wxWindowID id,
|
|||
wxEVT_SEARCH,
|
||||
m_searchBitmap);
|
||||
|
||||
SetBackgroundColour( m_text->GetBackgroundColour() );
|
||||
m_text->SetBackgroundColour(wxColour());
|
||||
SetBackgroundColour( m_text->GetBackgroundColour() );
|
||||
|
||||
RecalcBitmaps();
|
||||
|
||||
|
|
|
|||
|
|
@ -222,14 +222,16 @@ void wxQtDCImpl::SetBackground(const wxBrush& brush)
|
|||
{
|
||||
m_backgroundBrush = brush;
|
||||
|
||||
// For consistency with the other ports: clearing the dc with
|
||||
// invalid brush (Qt::NoBrush) should use white colour (which
|
||||
// happens to be the default colour in Qt too) instead of no
|
||||
// colour at all.
|
||||
if (!m_backgroundBrush.IsOk())
|
||||
m_backgroundBrush = *wxWHITE_BRUSH;
|
||||
|
||||
if (m_qtPainter->isActive())
|
||||
{
|
||||
// For consistency with the other ports: clearing the dc with
|
||||
// invalid brush (Qt::NoBrush) should use white colour (which
|
||||
// happens to be the default colour in Qt too) instead of no
|
||||
// colour at all.
|
||||
m_qtPainter->setBackground(
|
||||
brush.IsOk() ? brush.GetHandle() : Qt::white);
|
||||
m_qtPainter->setBackground(m_backgroundBrush.GetHandle());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1294,8 +1294,11 @@ bool wxWindowQt::SetBackgroundColour(const wxColour& colour)
|
|||
if ( !wxWindowBase::SetBackgroundColour(colour) )
|
||||
return false;
|
||||
|
||||
QWidget *widget = QtGetParentWidget();
|
||||
wxQtChangeRoleColour(widget->backgroundRole(), widget, colour);
|
||||
if ( colour.IsOk() )
|
||||
{
|
||||
QWidget *widget = QtGetParentWidget();
|
||||
wxQtChangeRoleColour(widget->backgroundRole(), widget, colour);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue