- if (state.GetSelectionState() != wxHTML_SEL_IN)
- {
- dc.SetTextBackground(m_Colour);
- dc.SetBackground(wxBrush(m_Colour, wxBRUSHSTYLE_SOLID));
- }
- else
- {
- wxColour c = info.GetStyle().GetSelectedTextBgColour(m_Colour);
- dc.SetTextBackground(c);
- dc.SetBackground(wxBrush(c, wxBRUSHSTYLE_SOLID));
- }
+ state.SetBgMode(wxSOLID);
+ const wxColour c = state.GetSelectionState() == wxHTML_SEL_IN
+ ? info.GetStyle().GetSelectedTextBgColour(m_Colour)
+ : m_Colour;
+ dc.SetTextBackground(c);
+ dc.SetBackground(c);
+ dc.SetBackgroundMode(wxSOLID);
+ }
+ if (m_Flags & wxHTML_CLR_TRANSPARENT_BACKGROUND)
+ {
+ state.SetBgColour(m_Colour);
+ state.SetBgMode(wxTRANSPARENT);
+ const wxColour c = state.GetSelectionState() == wxHTML_SEL_IN
+ ? info.GetStyle().GetSelectedTextBgColour(m_Colour)
+ : m_Colour;
+ dc.SetTextBackground(c);
+ dc.SetBackgroundMode(wxTRANSPARENT);