allow using a pixmap as background for slider
[enigma2.git] / lib / gui / ewidget.cpp
index cbc1a8c05f8e9b9687df89820c671d52714f3eda..7c50f4af47344d2f0153c36d3de0062a0f19e12d 100644 (file)
@@ -109,7 +109,7 @@ void eWidget::show()
        while (root && !root->m_desktop)
        {
                root = root->m_parent;
-               if (root)
+               if (!root)
                {
                                /* oops: our root widget does not have a desktop associated. 
                                        probably somebody already erased the root, but tries some
@@ -199,6 +199,21 @@ void eWidget::setTransparent(int transp)
                m_vis &=~wVisTransparent;
 }
 
+ePoint eWidget::getAbsolutePosition()
+{
+       eWidget *root = this;
+       ePoint abspos = position();
+
+       while (root && !root->m_desktop)
+       {
+               root = root->m_parent;
+               assert(root);
+               abspos += root->position();
+       }
+
+       return abspos;
+}
+
 void eWidget::mayKillFocus()
 {
        setFocus(0);