From 2f68e5be5964a24d68b7cd7816228ce340da3845 Mon Sep 17 00:00:00 2001 From: Robert Bieber Date: Sat, 3 Jul 2010 22:57:42 +0000 Subject: 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 --- utils/themeeditor/graphics/rbscreen.cpp | 37 ++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) (limited to 'utils/themeeditor/graphics/rbscreen.cpp') 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 @@ RBScreen::RBScreen(const RBRenderInfo& info, bool remote, QGraphicsItem *parent) :QGraphicsItem(parent), backdrop(0), project(project), - albumArt(0) + albumArt(0), customUI(0) { if(remote) { - width = info.device()->data("remotewidth").toInt(); - height = info.device()->data("remoteheight").toInt(); + fullWidth = info.device()->data("remotewidth").toInt(); + fullHeight = info.device()->data("remoteheight").toInt(); } else { - width = info.device()->data("screenwidth").toInt(); - height = info.device()->data("screenheight").toInt(); + fullWidth = info.device()->data("screenwidth").toInt(); + fullHeight = info.device()->data("screenheight").toInt(); } QString bg = info.settings()->value("background color", "FFFFFF"); @@ -63,8 +63,8 @@ RBScreen::RBScreen(const RBRenderInfo& info, bool remote, /* If a backdrop has been found, use its width and height */ if(!backdrop->isNull()) { - width = backdrop->width(); - height = backdrop->height(); + fullWidth = backdrop->width(); + fullHeight = backdrop->height(); } else { @@ -74,6 +74,17 @@ RBScreen::RBScreen(const RBRenderInfo& info, bool remote, } fonts.insert(0, new RBFont("Nothin'")); + + if(parent == 0) + { + width = fullWidth; + height = fullHeight; + } + else + { + width = parent->boundingRect().width(); + height = parent->boundingRect().height(); + } } RBScreen::~RBScreen() @@ -108,6 +119,9 @@ QRectF RBScreen::boundingRect() const void RBScreen::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { + if(parentItem() != 0) + return; + if(backdrop) { painter->drawPixmap(0, 0, width, height, *backdrop); @@ -191,9 +205,18 @@ void RBScreen::makeCustomUI(QString id) namedViewports.value(id)->at(i)->makeCustomUI(); for(int i = 0; i < namedViewports.value(id)->count(); i++) namedViewports.value(id)->at(i)->show(); + + customUI = namedViewports.value(id)->at(0); } } +void RBScreen::breakSBS() +{ + width = fullWidth; + height = fullHeight; + setParentItem(0); +} + QColor RBScreen::stringToColor(QString str, QColor fallback) { -- cgit v1.2.3