aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/skin.xml6
-rw-r--r--lib/gui/ewidget.cpp37
-rw-r--r--lib/gui/ewidget.h3
-rw-r--r--lib/gui/ewidgetdesktop.cpp27
-rw-r--r--skin.py2
5 files changed, 52 insertions, 23 deletions
diff --git a/data/skin.xml b/data/skin.xml
index f36874b2..1aa5da09 100644
--- a/data/skin.xml
+++ b/data/skin.xml
@@ -32,7 +32,7 @@
<pixmap pos="bpBottom" filename="/usr/share/enigma2/b_w_b.png" />
<pixmap pos="bpBottomRight" filename="/usr/share/enigma2/b_w_br.png" />
</borderset>
- </windowstyle> """ """
+ </windowstyle>
<screen name="Standby" flags="wfNoBorder" position="0,0" size="720,576" title="Standby">
</screen>
<screen name="Menu" position="210,150" size="300,235" title="Main menu">
@@ -143,7 +143,7 @@
<widget name="theClock" position="10,60" size="280,50" />
</screen>
<screen name="InfoBar" flags="wfNoBorder" position="0,380" size="720,148" title="InfoBar">
- <ePixmap position="0,0" zPosition="1" size="720,148" pixmap="/usr/share/enigma2/info-bg.png" />
+ <ePixmap position="0,0" zPosition="-1" size="720,148" pixmap="/usr/share/enigma2/info-bg.png" />
<widget name="BlinkingPoint" pixmap="/usr/share/enigma2/record.png" position="430,31" size="58,25" />
@@ -161,7 +161,7 @@
<widget name="Event_Next_Duration" position="555,98" size="70,26" font="Arial;22" backgroundColor="dark" />
<widget name="ButtonRed" pixmap="/usr/share/enigma2/button_red.png" position="210,132" size="27,12" />
- <widget name="ButtonRedText" position="240,132" size="75,22" font="Arial;13" backgroundColor="dark" />
+ <widget name="ButtonRedText" position="240,132" size="75,22" font="Arial;13" backgroundColor="dark" transparent="1" />
<widget name="ButtonGreen" pixmap="/usr/share/enigma2/button_green.png" position="320,132" size="27,12" />
<widget name="ButtonYellow" pixmap="/usr/share/enigma2/button_yellow.png" position="430,132" size="27,12" />
<widget name="ButtonBlue" pixmap="/usr/share/enigma2/button_blue.png" position="540,132" size="27,12" />
diff --git a/lib/gui/ewidget.cpp b/lib/gui/ewidget.cpp
index b047f5fb..b4c24d86 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<eWidget>::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, &region, &painter);
}
+
+ childs.moveBy(-position());
+ /* walk all childs */
+ for (ePtrList<eWidget>::iterator i(m_childs.begin()); i != m_childs.end(); ++i)
+ i->doPaint(painter, childs);
painter.moveOffset(-position());
}
@@ -272,15 +282,18 @@ int eWidget::event(int event, void *data, void *data2)
// eDebug("eWidget::evtPaint");
// dumpRegion(*(gRegion*)data);
- if (!m_have_background_color)
- {
- ePtr<eWindowStyle> style;
- if (!getStyle(style))
- style->paintBackground(painter, ePoint(0, 0), size());
- } else
+ if (!isTransparent())
{
- painter.setBackgroundColor(m_background_color);
- painter.clear();
+ if (!m_have_background_color)
+ {
+ ePtr<eWindowStyle> style;
+ if (!getStyle(style))
+ style->paintBackground(painter, ePoint(0, 0), size());
+ } else
+ {
+ painter.setBackgroundColor(m_background_color);
+ painter.clear();
+ }
}
break;
}
diff --git a/lib/gui/ewidget.h b/lib/gui/ewidget.h
index 879e5eaa..db86fd10 100644
--- a/lib/gui/ewidget.h
+++ b/lib/gui/ewidget.h
@@ -40,10 +40,13 @@ public:
void clearBackgroundColor();
void setZPosition(int z);
+ void setTransparent(int transp);
/* untested code */
int isVisible() { return (m_vis & wVisShow) && ((!m_parent) || m_parent->isVisible()); }
/* ... */
+
+ int isTransparent() { return m_vis & wVisTransparent; }
eWidgetAnimation m_animation;
private:
diff --git a/lib/gui/ewidgetdesktop.cpp b/lib/gui/ewidgetdesktop.cpp
index afe1995c..c89cd270 100644
--- a/lib/gui/ewidgetdesktop.cpp
+++ b/lib/gui/ewidgetdesktop.cpp
@@ -51,10 +51,10 @@ void eWidgetDesktop::calcWidgetClipRegion(eWidget *widget, gRegion &parent_visib
widget->m_visible_region = widget->m_clip_region;
widget->m_visible_region.moveBy(widget->position());
widget->m_visible_region &= parent_visible; // in parent space!
- /* TODO: check transparency here! */
- /* remove everything this widget will contain from parent's visible list */
- parent_visible -= widget->m_visible_region; // will remove child regions too!
+ if (!widget->isTransparent())
+ /* remove everything this widget will contain from parent's visible list, unless widget is transparent. */
+ parent_visible -= widget->m_visible_region; // will remove child regions too!
/* now prepare for recursing to childs */
widget->m_visible_region.moveBy(-widget->position()); // now in local space
@@ -63,11 +63,22 @@ void eWidgetDesktop::calcWidgetClipRegion(eWidget *widget, gRegion &parent_visib
widget->m_visible_with_childs = widget->m_visible_region;
- for (ePtrList<eWidget>::iterator i(widget->m_childs.begin()); i != widget->m_childs.end(); ++i)
- if (i->m_vis & eWidget::wVisShow)
- calcWidgetClipRegion(*i, widget->m_visible_region);
- else
- clearVisibility(*i);
+ /* add childs in reverse (Z) order - we're going from front-to-bottom here. */
+ ePtrList<eWidget>::iterator i(widget->m_childs.end());
+
+ for (;;)
+ {
+ if (i != widget->m_childs.end())
+ {
+ if (i->m_vis & eWidget::wVisShow)
+ calcWidgetClipRegion(*i, widget->m_visible_region);
+ else
+ clearVisibility(*i);
+ }
+ if (i == widget->m_childs.begin())
+ break;
+ --i;
+ }
}
void eWidgetDesktop::recalcClipRegions(eWidget *root)
diff --git a/skin.py b/skin.py
index a4095204..d11cce02 100644
--- a/skin.py
+++ b/skin.py
@@ -128,6 +128,8 @@ def applySingleAttribute(guiObject, desktop, attrib, value):
guiObject.setForegroundColor(parseColor(value))
elif attrib == "selectionDisabled":
guiObject.setSelectionEnable(0)
+ elif attrib == "transparent":
+ guiObject.setTransparent(int(value))
elif attrib != 'name':
print "unsupported attribute " + attrib + "=" + value
except int: