Use conditional operator instead of conditional statement

This commit is contained in:
Artur Wieczorek
2018-12-28 09:35:43 +01:00
parent 9d2fbef751
commit 18e03af068

View File

@@ -2284,10 +2284,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc,
else if ( isPgEnabled )
{
rowFgCol = m_colPropFore;
if ( p == firstSelected )
rowBgCol = m_colMargin;
else
rowBgCol = selBackCol;
rowBgCol = p == firstSelected ? m_colMargin : selBackCol;
}
else
{
@@ -2440,10 +2437,7 @@ int wxPropertyGrid::DoDrawItems( wxDC& dc,
{
dc.SetBrush(m_colPropBack);
dc.SetPen(m_colPropBack);
if ( p->IsEnabled() )
dc.SetTextForeground(m_colPropFore);
else
dc.SetTextForeground(m_colDisPropFore);
dc.SetTextForeground(p->IsEnabled() ? m_colPropFore : m_colDisPropFore);
}
}
else