From: Felix Domke Date: Sat, 8 Apr 2006 00:56:43 +0000 (+0000) Subject: add getAbsolutePosition X-Git-Tag: 2.6.0~3673 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/6ce3896800e92c0c51ebb72d86191f526af66971 add getAbsolutePosition --- diff --git a/lib/gui/ewidget.cpp b/lib/gui/ewidget.cpp index ef784997..7c50f4af 100644 --- a/lib/gui/ewidget.cpp +++ b/lib/gui/ewidget.cpp @@ -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); diff --git a/lib/gui/ewidget.h b/lib/gui/ewidget.h index 3ddfdc26..4175eae7 100644 --- a/lib/gui/ewidget.h +++ b/lib/gui/ewidget.h @@ -48,6 +48,8 @@ public: int isTransparent() { return m_vis & wVisTransparent; } + ePoint getAbsolutePosition(); + eWidgetAnimation m_animation; private: eWidgetDesktop *m_desktop;