raise SkinErrors instead of string
[enigma2.git] / lib / gui / elistboxcontent.cpp
index 8c7a5005e17c13bbbb9d9aaba71be7bf1fec71aa..8331ca1123ad6026d32d78b100d242e8ffa2edf9 100644 (file)
@@ -153,7 +153,7 @@ void eListboxPythonStringContent::paint(gPainter &painter, eWindowStyle &style,
 
                /* same for foreground */
        if (local_style && local_style->m_foreground_color_set)
-               painter.setBackgroundColor(local_style->m_foreground_color);
+               painter.setForegroundColor(local_style->m_foreground_color);
 
                /* if we have no transparent background */
        if (!local_style || !local_style->m_transparent_background)
@@ -165,8 +165,10 @@ void eListboxPythonStringContent::paint(gPainter &painter, eWindowStyle &style,
                        painter.clear();
        } else
        {
-               if (local_style && local_style->m_background)
+               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();
        }
 
        if (m_list && cursorValid())
@@ -272,7 +274,7 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style,
 
                /* same for foreground */
        if (local_style && local_style->m_foreground_color_set)
-               painter.setBackgroundColor(local_style->m_foreground_color);
+               painter.setForegroundColor(local_style->m_foreground_color);
 
        if (!local_style || !local_style->m_transparent_background)
                /* if we have no transparent background */
@@ -284,8 +286,10 @@ void eListboxPythonConfigContent::paint(gPainter &painter, eWindowStyle &style,
                        painter.clear();
        } else
        {
-               if (local_style && local_style->m_background)
+               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();
        }
 
        if (m_list && cursorValid())
@@ -478,16 +482,12 @@ static void clearRegion(gPainter &painter, eWindowStyle &style, eListboxStyle *l
                {
                        int color = PyInt_AsLong(pbackColor);
                        painter.setBackgroundColor(gRGB(color));
-               }
-               else if (local_style)
-               {
-                       // transparent background?
-                       if (local_style->m_transparent_background) 
-                               clear=false;
-                       // if we have a local background color set, use that. 
-                       else if (local_style->m_background_color_set)
-                               painter.setBackgroundColor(local_style->m_background_color);
-               }
+               } // transparent background?
+               else if (local_style && local_style->m_transparent_background) 
+                       clear=false;
+               // if we have a local background color set, use that. 
+               else if (local_style && local_style->m_background_color_set)
+                       painter.setBackgroundColor(local_style->m_background_color);
                else
                        style.setStyle(painter, eWindowStyle::styleListboxNormal);
                if (clear)
@@ -542,7 +542,7 @@ static void clearRegion(gPainter &painter, eWindowStyle &style, eListboxStyle *l
                painter.setForegroundColor(gRGB(color));
        }/* if we have a local foreground color set, use that. */
        else if (local_style && local_style->m_foreground_color_set)
-               painter.setBackgroundColor(local_style->m_foreground_color);
+               painter.setForegroundColor(local_style->m_foreground_color);
 }
 
 void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected)