summaryrefslogtreecommitdiff
path: root/utils/themeeditor/graphics
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-07-01 02:07:41 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-07-01 02:07:41 +0000
commit8cd51a70c58afc67136d889400a0aafe68107ff1 (patch)
treed9907f78240394fea2784287e349e7017fadc989 /utils/themeeditor/graphics
parent82618e82e6f23d67d2da4560288f7e1f1079813b (diff)
downloadrockbox-8cd51a70c58afc67136d889400a0aafe68107ff1.tar.gz
rockbox-8cd51a70c58afc67136d889400a0aafe68107ff1.zip
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
Diffstat (limited to 'utils/themeeditor/graphics')
-rw-r--r--utils/themeeditor/graphics/rbviewport.cpp8
1 files changed, 8 insertions, 0 deletions
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)
93 } 93 }
94 /* Now we grab the info common to all viewports */ 94 /* Now we grab the info common to all viewports */
95 x = node->params[param++].data.numeric; 95 x = node->params[param++].data.numeric;
96 if(x < 0)
97 x = info.screen()->boundingRect().right() + x;
96 y = node->params[param++].data.numeric; 98 y = node->params[param++].data.numeric;
99 if(y < 0)
100 y = info.screen()->boundingRect().bottom() + y;
97 101
98 if(node->params[param].type == skin_tag_parameter::DEFAULT) 102 if(node->params[param].type == skin_tag_parameter::DEFAULT)
99 w = info.screen()->getWidth() - x; 103 w = info.screen()->getWidth() - x;
100 else 104 else
101 w = node->params[param].data.numeric; 105 w = node->params[param].data.numeric;
106 if(w < 0)
107 w = info.screen()->getWidth() + w - x;
102 108
103 if(node->params[++param].type == skin_tag_parameter::DEFAULT) 109 if(node->params[++param].type == skin_tag_parameter::DEFAULT)
104 h = info.screen()->getHeight() - y; 110 h = info.screen()->getHeight() - y;
105 else 111 else
106 h = node->params[param].data.numeric; 112 h = node->params[param].data.numeric;
113 if(h < 0)
114 h = info.screen()->getHeight() + h - y;
107 115
108 setPos(x, y); 116 setPos(x, y);
109 size = QRectF(0, 0, w, h); 117 size = QRectF(0, 0, w, h);