From 8cd51a70c58afc67136d889400a0aafe68107ff1 Mon Sep 17 00:00:00 2001 From: Robert Bieber Date: Thu, 1 Jul 2010 02:07:41 +0000 Subject: Theme Editor: Implemented negative x/y/w/h values in viewport declarations git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27205 a1c6a512-1295-4272-9138-f99709370657 --- utils/themeeditor/graphics/rbviewport.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'utils/themeeditor/graphics/rbviewport.cpp') diff --git a/utils/themeeditor/graphics/rbviewport.cpp b/utils/themeeditor/graphics/rbviewport.cpp index 4b85a30661..138a6b52bc 100644 --- a/utils/themeeditor/graphics/rbviewport.cpp +++ b/utils/themeeditor/graphics/rbviewport.cpp @@ -93,17 +93,25 @@ RBViewport::RBViewport(skin_element* node, const RBRenderInfo& info) } /* Now we grab the info common to all viewports */ x = node->params[param++].data.numeric; + if(x < 0) + x = info.screen()->boundingRect().right() + x; y = node->params[param++].data.numeric; + if(y < 0) + y = info.screen()->boundingRect().bottom() + y; if(node->params[param].type == skin_tag_parameter::DEFAULT) w = info.screen()->getWidth() - x; else w = node->params[param].data.numeric; + if(w < 0) + w = info.screen()->getWidth() + w - x; if(node->params[++param].type == skin_tag_parameter::DEFAULT) h = info.screen()->getHeight() - y; else h = node->params[param].data.numeric; + if(h < 0) + h = info.screen()->getHeight() + h - y; setPos(x, y); size = QRectF(0, 0, w, h); -- cgit v1.2.3