- /* if we have a local background color set, use that. */
- if (local_style && local_style->m_background_color_set)
- painter.setBackgroundColor(local_style->m_background_color);
-
- /* same for foreground */
- if (local_style && local_style->m_foreground_color_set)
- painter.setBackgroundColor(local_style->m_foreground_color);
+ if (local_style)
+ {
+ if (selected)
+ {
+ /* if we have a local background color set, use that. */
+ if (local_style->m_background_color_selected_set)
+ painter.setBackgroundColor(local_style->m_background_color_selected);
+ /* same for foreground */
+ if (local_style->m_foreground_color_selected_set)
+ painter.setForegroundColor(local_style->m_foreground_color_selected);
+ }
+ else
+ {
+ /* if we have a local background color set, use that. */
+ if (local_style->m_background_color_set)
+ painter.setBackgroundColor(local_style->m_background_color);
+ /* same for foreground */
+ if (local_style->m_foreground_color_set)
+ painter.setForegroundColor(local_style->m_foreground_color);
+ }
+ }