allow use of alphablended pixmaps in multicontent lists
authorFelix Domke <felix.domke@multimedia-labs.de>
Thu, 16 Jul 2009 21:39:16 +0000 (23:39 +0200)
committerFelix Domke <felix.domke@multimedia-labs.de>
Thu, 16 Jul 2009 21:39:30 +0000 (23:39 +0200)
lib/gui/elistboxcontent.cpp
lib/gui/elistboxcontent.h
lib/python/Components/MultiContent.py

index e05da215913fc121cd4abc7d3dc3e4f39abfb600..4b4b58c1bc2c458d7e6d08dfd7ce06cf32b313ab 100644 (file)
@@ -945,6 +945,7 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
 
                                break;
                        }
+                       case TYPE_PIXMAP_ALPHABLEND:
                        case TYPE_PIXMAP_ALPHATEST:
                        case TYPE_PIXMAP: // pixmap
                        {
@@ -997,7 +998,7 @@ void eListboxPythonMultiContent::paint(gPainter &painter, eWindowStyle &style, c
                                        clearRegion(painter, style, local_style, ePyObject(), ePyObject(), pbackColor, pbackColorSelected, selected, rc, sel_clip, offset, cursorValid);
                                }
 
-                               painter.blit(pixmap, rect.topLeft(), rect, (type == TYPE_PIXMAP_ALPHATEST) ? gPainter::BT_ALPHATEST : 0);
+                               painter.blit(pixmap, rect.topLeft(), rect, (type == TYPE_PIXMAP_ALPHATEST) ? gPainter::BT_ALPHATEST : (type == TYPE_PIXMAP_ALPHABLEND) ? gPainter::BT_ALPHABLEND : 0);
                                painter.clippop();
                                break;
                        }
index 6bb45590e433ab51c8a34136c8978f125dd44a03..d3d2a08937814e15ae343702d3528beb76b02a57 100644 (file)
@@ -69,7 +69,7 @@ class eListboxPythonMultiContent: public eListboxPythonStringContent
 public:
        eListboxPythonMultiContent();
        ~eListboxPythonMultiContent();
-       enum { TYPE_TEXT, TYPE_PROGRESS, TYPE_PIXMAP, TYPE_PIXMAP_ALPHATEST };
+       enum { TYPE_TEXT, TYPE_PROGRESS, TYPE_PIXMAP, TYPE_PIXMAP_ALPHATEST, TYPE_PIXMAP_ALPHABLEND };
        void paint(gPainter &painter, eWindowStyle &style, const ePoint &offset, int selected);
        int currentCursorSelectable();
        void setList(SWIG_PYOBJECT(ePyObject) list);
index 6afd0941c081fe5878482d8d2fc922ee08be9a9d..1e6f3e0229a068b56a2841c35994a0d6380bf251 100644 (file)
@@ -11,6 +11,9 @@ def MultiContentEntryPixmap(pos = (0, 0), size = (0, 0), png = None, backcolor =
 def MultiContentEntryPixmapAlphaTest(pos = (0, 0), size = (0, 0), png = None, backcolor = None, backcolor_sel = None):
        return (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, pos[0], pos[1], size[0], size[1], png, backcolor, backcolor_sel)
 
+def MultiContentEntryPixmapAlphaBlend(pos = (0, 0), size = (0, 0), png = None, backcolor = None, backcolor_sel = None):
+       return (eListboxPythonMultiContent.TYPE_PIXMAP_ALPHABLEND, pos[0], pos[1], size[0], size[1], png, backcolor, backcolor_sel)
+
 def MultiContentEntryProgress(pos = (0, 0), size = (0, 0), percent = None, borderWidth = None, foreColor = None, backColor = None, backColorSelected = None):
        return (eListboxPythonMultiContent.TYPE_PROGRESS, pos[0], pos[1], size[0], size[1], percent, borderWidth, foreColor, backColor, backColorSelected)