summaryrefslogtreecommitdiff
path: root/utils/themeeditor/graphics/rbscreen.cpp
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-07-03 22:57:42 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-07-03 22:57:42 +0000
commit2f68e5be5964a24d68b7cd7816228ce340da3845 (patch)
treef3099d16b09d1cd6ac1f7d431978e84413ef4759 /utils/themeeditor/graphics/rbscreen.cpp
parent8da13a5d4bd69884242cdb4170d451239aa23d03 (diff)
downloadrockbox-2f68e5be5964a24d68b7cd7816228ce340da3845.tar.gz
rockbox-2f68e5be5964a24d68b7cd7816228ce340da3845.zip
Theme Editor: SBS will now render underneath WPS, if both are present in project
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27265 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/graphics/rbscreen.cpp')
-rw-r--r--utils/themeeditor/graphics/rbscreen.cpp37
1 files changed, 30 insertions, 7 deletions
diff --git a/utils/themeeditor/graphics/rbscreen.cpp b/utils/themeeditor/graphics/rbscreen.cpp
index 054e8fee37..c212a6c1fc 100644
--- a/utils/themeeditor/graphics/rbscreen.cpp
+++ b/utils/themeeditor/graphics/rbscreen.cpp
@@ -29,18 +29,18 @@
29RBScreen::RBScreen(const RBRenderInfo& info, bool remote, 29RBScreen::RBScreen(const RBRenderInfo& info, bool remote,
30 QGraphicsItem *parent) 30 QGraphicsItem *parent)
31 :QGraphicsItem(parent), backdrop(0), project(project), 31 :QGraphicsItem(parent), backdrop(0), project(project),
32 albumArt(0) 32 albumArt(0), customUI(0)
33{ 33{
34 34
35 if(remote) 35 if(remote)
36 { 36 {
37 width = info.device()->data("remotewidth").toInt(); 37 fullWidth = info.device()->data("remotewidth").toInt();
38 height = info.device()->data("remoteheight").toInt(); 38 fullHeight = info.device()->data("remoteheight").toInt();
39 } 39 }
40 else 40 else
41 { 41 {
42 width = info.device()->data("screenwidth").toInt(); 42 fullWidth = info.device()->data("screenwidth").toInt();
43 height = info.device()->data("screenheight").toInt(); 43 fullHeight = info.device()->data("screenheight").toInt();
44 } 44 }
45 45
46 QString bg = info.settings()->value("background color", "FFFFFF"); 46 QString bg = info.settings()->value("background color", "FFFFFF");
@@ -63,8 +63,8 @@ RBScreen::RBScreen(const RBRenderInfo& info, bool remote,
63 /* If a backdrop has been found, use its width and height */ 63 /* If a backdrop has been found, use its width and height */
64 if(!backdrop->isNull()) 64 if(!backdrop->isNull())
65 { 65 {
66 width = backdrop->width(); 66 fullWidth = backdrop->width();
67 height = backdrop->height(); 67 fullHeight = backdrop->height();
68 } 68 }
69 else 69 else
70 { 70 {
@@ -74,6 +74,17 @@ RBScreen::RBScreen(const RBRenderInfo& info, bool remote,
74 } 74 }
75 75
76 fonts.insert(0, new RBFont("Nothin'")); 76 fonts.insert(0, new RBFont("Nothin'"));
77
78 if(parent == 0)
79 {
80 width = fullWidth;
81 height = fullHeight;
82 }
83 else
84 {
85 width = parent->boundingRect().width();
86 height = parent->boundingRect().height();
87 }
77} 88}
78 89
79RBScreen::~RBScreen() 90RBScreen::~RBScreen()
@@ -108,6 +119,9 @@ QRectF RBScreen::boundingRect() const
108void RBScreen::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, 119void RBScreen::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
109 QWidget *widget) 120 QWidget *widget)
110{ 121{
122 if(parentItem() != 0)
123 return;
124
111 if(backdrop) 125 if(backdrop)
112 { 126 {
113 painter->drawPixmap(0, 0, width, height, *backdrop); 127 painter->drawPixmap(0, 0, width, height, *backdrop);
@@ -191,9 +205,18 @@ void RBScreen::makeCustomUI(QString id)
191 namedViewports.value(id)->at(i)->makeCustomUI(); 205 namedViewports.value(id)->at(i)->makeCustomUI();
192 for(int i = 0; i < namedViewports.value(id)->count(); i++) 206 for(int i = 0; i < namedViewports.value(id)->count(); i++)
193 namedViewports.value(id)->at(i)->show(); 207 namedViewports.value(id)->at(i)->show();
208
209 customUI = namedViewports.value(id)->at(0);
194 } 210 }
195} 211}
196 212
213void RBScreen::breakSBS()
214{
215 width = fullWidth;
216 height = fullHeight;
217 setParentItem(0);
218}
219
197QColor RBScreen::stringToColor(QString str, QColor fallback) 220QColor RBScreen::stringToColor(QString str, QColor fallback)
198{ 221{
199 222