forked from len0rd/rockbox
Theme Editor: Implemented status bar enable/disable
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27200 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
8114979e8e
commit
35150b6dcb
8 changed files with 43 additions and 3 deletions
|
@ -29,7 +29,8 @@
|
||||||
RBScreen::RBScreen(const RBRenderInfo& info, bool remote,
|
RBScreen::RBScreen(const RBRenderInfo& info, bool remote,
|
||||||
QGraphicsItem *parent)
|
QGraphicsItem *parent)
|
||||||
:QGraphicsItem(parent), backdrop(0), project(project),
|
:QGraphicsItem(parent), backdrop(0), project(project),
|
||||||
albumArt(0)
|
albumArt(0), defaultStatusBar(true),
|
||||||
|
statusBarTexture(":/render/statusbar.png")
|
||||||
{
|
{
|
||||||
|
|
||||||
if(remote)
|
if(remote)
|
||||||
|
@ -116,6 +117,9 @@ void RBScreen::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
{
|
{
|
||||||
painter->fillRect(0, 0, width, height, bgColor);
|
painter->fillRect(0, 0, width, height, bgColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(defaultStatusBar)
|
||||||
|
painter->fillRect(QRectF(0, 0, width, 8), statusBarTexture);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RBScreen::loadViewport(QString name, RBViewport *view)
|
void RBScreen::loadViewport(QString name, RBViewport *view)
|
||||||
|
|
|
@ -83,6 +83,8 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void disableStatusBar(){ defaultStatusBar = false; }
|
||||||
|
void enableStatusBar(){ defaultStatusBar = true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int width;
|
int width;
|
||||||
|
@ -102,6 +104,9 @@ private:
|
||||||
|
|
||||||
RBAlbumArt* albumArt;
|
RBAlbumArt* albumArt;
|
||||||
|
|
||||||
|
bool defaultStatusBar;
|
||||||
|
QPixmap statusBarTexture;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // RBSCREEN_H
|
#endif // RBSCREEN_H
|
||||||
|
|
|
@ -33,7 +33,8 @@ RBViewport::RBViewport(skin_element* node, const RBRenderInfo& info)
|
||||||
: QGraphicsItem(info.screen()), font(info.screen()->getFont(0)),
|
: QGraphicsItem(info.screen()), font(info.screen()->getFont(0)),
|
||||||
foreground(info.screen()->foreground()),
|
foreground(info.screen()->foreground()),
|
||||||
background(info.screen()->background()), textOffset(0,0),
|
background(info.screen()->background()), textOffset(0,0),
|
||||||
screen(info.screen()), textAlign(Left)
|
screen(info.screen()), textAlign(Left), showStatusBar(false),
|
||||||
|
statusBarTexture(":/render/statusbar.png")
|
||||||
{
|
{
|
||||||
if(!node->tag)
|
if(!node->tag)
|
||||||
{
|
{
|
||||||
|
@ -140,6 +141,9 @@ void RBViewport::paint(QPainter *painter,
|
||||||
painter->setPen(customUI ? Qt::blue : Qt::red);
|
painter->setPen(customUI ? Qt::blue : Qt::red);
|
||||||
if(debug)
|
if(debug)
|
||||||
painter->drawRect(size);
|
painter->drawRect(size);
|
||||||
|
|
||||||
|
if(showStatusBar)
|
||||||
|
painter->fillRect(QRectF(0, 0, size.width(), 8), statusBarTexture);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RBViewport::newLine()
|
void RBViewport::newLine()
|
||||||
|
|
|
@ -57,6 +57,8 @@ public:
|
||||||
void write(QString text);
|
void write(QString text);
|
||||||
void alignText(Alignment align){ textAlign = align; }
|
void alignText(Alignment align){ textAlign = align; }
|
||||||
|
|
||||||
|
void enableStatusBar(){ showStatusBar = true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void alignLeft();
|
void alignLeft();
|
||||||
|
@ -79,6 +81,9 @@ private:
|
||||||
QList<QGraphicsItem*> centerText;
|
QList<QGraphicsItem*> centerText;
|
||||||
QList<QGraphicsItem*> rightText;
|
QList<QGraphicsItem*> rightText;
|
||||||
Alignment textAlign;
|
Alignment textAlign;
|
||||||
|
|
||||||
|
bool showStatusBar;
|
||||||
|
QPixmap statusBarTexture;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // RBVIEWPORT_H
|
#endif // RBVIEWPORT_H
|
||||||
|
|
|
@ -611,6 +611,25 @@ bool ParseTreeNode::execTag(const RBRenderInfo& info, RBViewport* viewport)
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
case 'w':
|
||||||
|
switch(element->tag->name[1])
|
||||||
|
{
|
||||||
|
case 'd':
|
||||||
|
info.screen()->disableStatusBar();
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case 'e':
|
||||||
|
info.screen()->enableStatusBar();
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case 'i':
|
||||||
|
info.screen()->disableStatusBar();
|
||||||
|
viewport->enableStatusBar();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
|
||||||
case 'x':
|
case 'x':
|
||||||
switch(element->tag->name[1])
|
switch(element->tag->name[1])
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,5 +13,6 @@
|
||||||
<qresource prefix="/render">
|
<qresource prefix="/render">
|
||||||
<file alias="scenebg.png">resources/render/scenebg.png</file>
|
<file alias="scenebg.png">resources/render/scenebg.png</file>
|
||||||
<file alias="albumart.png">resources/render/albumart.png</file>
|
<file alias="albumart.png">resources/render/albumart.png</file>
|
||||||
|
<file alias="statusbar.png">resources/render/statusbar.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
BIN
utils/themeeditor/resources/render/statusbar.png
Normal file
BIN
utils/themeeditor/resources/render/statusbar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 242 B |
|
@ -72,7 +72,9 @@ OTHER_FILES += README \
|
||||||
resources/document-save.png \
|
resources/document-save.png \
|
||||||
resources/document-open.png \
|
resources/document-open.png \
|
||||||
resources/document-new.png \
|
resources/document-new.png \
|
||||||
resources/deviceoptions
|
resources/deviceoptions \
|
||||||
|
resources/render/statusbar.png \
|
||||||
|
resources/render/scenebg.png
|
||||||
FORMS += gui/editorwindow.ui \
|
FORMS += gui/editorwindow.ui \
|
||||||
gui/preferencesdialog.ui \
|
gui/preferencesdialog.ui \
|
||||||
gui/configdocument.ui \
|
gui/configdocument.ui \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue