+
+ eListboxStyle *local_style = 0;
+
+ /* get local listbox style, if present */
+ if (m_listbox)
+ local_style = m_listbox->getLocalStyle();
+
+ if (marked == 1) // marked
+ {
+ style.setStyle(painter, eWindowStyle::styleListboxMarked);
+ if (m_color_set[markedForeground])
+ painter.setForegroundColor(m_color[markedForeground]);
+ if (m_color_set[markedBackground])
+ painter.setBackgroundColor(m_color[markedBackground]);
+ }
+ else if (marked == 2) // marked and selected
+ {
+ style.setStyle(painter, eWindowStyle::styleListboxMarkedAndSelected);
+ if (m_color_set[markedForegroundSelected])
+ painter.setForegroundColor(m_color[markedForegroundSelected]);
+ if (m_color_set[markedBackgroundSelected])
+ painter.setBackgroundColor(m_color[markedBackgroundSelected]);
+ }
+ else 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);
+ }
+ }
+
+ if (!local_style || !local_style->m_transparent_background)
+ /* if we have no transparent background */
+ {
+ /* blit background picture, if available (otherwise, clear only) */
+ if (local_style && local_style->m_background)
+ painter.blit(local_style->m_background, offset, eRect(), 0);
+ else
+ painter.clear();
+ } else
+ {
+ if (local_style->m_background)
+ painter.blit(local_style->m_background, offset, eRect(), gPainter::BT_ALPHATEST);
+ else if (selected && !local_style->m_selection)
+ painter.clear();
+ }
+