X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/a895ba81ff7b76551cd5c1c44083a081ef56106b..c72e1837b5fd6f2d0e222d7140008326fe89a58e:/lib/gui/ewidget.cpp diff --git a/lib/gui/ewidget.cpp b/lib/gui/ewidget.cpp index b047f5fb..26ccfba3 100644 --- a/lib/gui/ewidget.cpp +++ b/lib/gui/ewidget.cpp @@ -177,6 +177,14 @@ void eWidget::setZPosition(int z) insertIntoParent(); /* now at the new Z position */ } +void eWidget::setTransparent(int transp) +{ + if (transp) + m_vis |= wVisTransparent; + else + m_vis &=~wVisTransparent; +} + void eWidget::mayKillFocus() { setFocus(0); @@ -224,14 +232,11 @@ void eWidget::doPaint(gPainter &painter, const gRegion &r) if (m_visible_with_childs.empty()) return; - gRegion region = r; + gRegion region = r, childs = r; /* we were in parent's space, now we are in local space */ region.moveBy(-position()); painter.moveOffset(position()); - /* walk all childs */ - for (ePtrList::iterator i(m_childs.begin()); i != m_childs.end(); ++i) - i->doPaint(painter, region); /* check if there's anything for us to paint */ region &= m_visible_region; @@ -241,6 +246,11 @@ void eWidget::doPaint(gPainter &painter, const gRegion &r) painter.resetClip(region); event(evtPaint, ®ion, &painter); } + + childs.moveBy(-position()); + /* walk all childs */ + for (ePtrList::iterator i(m_childs.begin()); i != m_childs.end(); ++i) + i->doPaint(painter, childs); painter.moveOffset(-position()); } @@ -272,15 +282,22 @@ int eWidget::event(int event, void *data, void *data2) // eDebug("eWidget::evtPaint"); // dumpRegion(*(gRegion*)data); - if (!m_have_background_color) + if (!isTransparent()) { - ePtr style; - if (!getStyle(style)) - style->paintBackground(painter, ePoint(0, 0), size()); + if (!m_have_background_color) + { + ePtr style; + if (!getStyle(style)) + style->paintBackground(painter, ePoint(0, 0), size()); + } else + { + painter.setBackgroundColor(m_background_color); + painter.clear(); + } } else { - painter.setBackgroundColor(m_background_color); - painter.clear(); + if (m_have_background_color) + painter.setBackgroundColor(m_background_color); } break; }