summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-08-13 02:05:38 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-08-13 02:05:38 +0000
commitb477463d9c85d6dbb57e2688a1fec00c8af147b1 (patch)
tree5d21bdf30f57a53356439d1fd4cd4451df0a72ef
parent9ba67fb35e14751c2ce6b9f80a9ad57cf4ffaf74 (diff)
downloadrockbox-b477463d9c85d6dbb57e2688a1fec00c8af147b1.tar.gz
rockbox-b477463d9c85d6dbb57e2688a1fec00c8af147b1.zip
Theme Editor: Altered implementation of %ax tag so that viewport now simply mirrors itself across the screen.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27798 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--utils/themeeditor/graphics/rbviewport.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/utils/themeeditor/graphics/rbviewport.cpp b/utils/themeeditor/graphics/rbviewport.cpp
index 5cac806c3d..f646d830dd 100644
--- a/utils/themeeditor/graphics/rbviewport.cpp
+++ b/utils/themeeditor/graphics/rbviewport.cpp
@@ -48,8 +48,6 @@ RBViewport::RBViewport(skin_element* node, const RBRenderInfo& info,
48 leftGraphic(0), centerGraphic(0), rightGraphic(0), scrollTime(0), 48 leftGraphic(0), centerGraphic(0), rightGraphic(0), scrollTime(0),
49 node(pNode), doc(info.document()) 49 node(pNode), doc(info.document())
50{ 50{
51 mirrored = info.screen()->isRtlMirrored()
52 && info.device()->data("rtl").toBool();
53 51
54 if(!node->tag) 52 if(!node->tag)
55 { 53 {
@@ -150,12 +148,6 @@ RBViewport::RBViewport(skin_element* node, const RBRenderInfo& info,
150 y -= screen->parentItem()->pos().y(); 148 y -= screen->parentItem()->pos().y();
151 } 149 }
152 150
153 /* Mirroring if necessary */
154 if(mirrored)
155 {
156 x = parentItem()->boundingRect().width() - w - x;
157 }
158
159 if(node->params[++param].type == skin_tag_parameter::DEFAULT) 151 if(node->params[++param].type == skin_tag_parameter::DEFAULT)
160 font = screen->getFont(1); 152 font = screen->getFont(1);
161 else 153 else
@@ -167,6 +159,17 @@ RBViewport::RBViewport(skin_element* node, const RBRenderInfo& info,
167 159
168 debug = info.device()->data("showviewports").toBool(); 160 debug = info.device()->data("showviewports").toBool();
169 lineHeight = font->lineHeight(); 161 lineHeight = font->lineHeight();
162
163 if(info.screen()->isRtlMirrored() && info.device()->data("rtl").toBool())
164 {
165 /* Mirroring the viewport */
166 double x = screen->boundingRect().width() - 2 * pos().x();
167 QTransform t;
168 t.translate(x, 0);
169 t.scale(-1, 1);
170 setTransform(t);
171 }
172
170 if(customUI) 173 if(customUI)
171 screen->setCustomUI(this); 174 screen->setCustomUI(this);
172} 175}
@@ -236,10 +239,6 @@ void RBViewport::write(QString text)
236 return; 239 return;
237 240
238 Alignment align = textAlign; 241 Alignment align = textAlign;
239 if(mirrored && align == Left)
240 align = Right;
241 else if(mirrored && align == Right)
242 align = Left;
243 242
244 if(align == Left) 243 if(align == Left)
245 { 244 {