forked from len0rd/rockbox
Theme Editor: Fixed bug that crashed conditionals nested in sublines, began work on making progress bars implement RBMovable
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27714 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
265ee156f2
commit
f657e49103
3 changed files with 16 additions and 2 deletions
|
@ -27,7 +27,7 @@
|
||||||
RBProgressBar::RBProgressBar(RBViewport *parent, const RBRenderInfo &info,
|
RBProgressBar::RBProgressBar(RBViewport *parent, const RBRenderInfo &info,
|
||||||
int paramCount, skin_tag_parameter *params,
|
int paramCount, skin_tag_parameter *params,
|
||||||
bool pv)
|
bool pv)
|
||||||
:QGraphicsItem(parent)
|
:RBMovable(parent)
|
||||||
{
|
{
|
||||||
/* First we set everything to defaults */
|
/* First we set everything to defaults */
|
||||||
bitmap = 0;
|
bitmap = 0;
|
||||||
|
@ -117,4 +117,11 @@ void RBProgressBar::paint(QPainter *painter,
|
||||||
{
|
{
|
||||||
painter->fillRect(size, color);
|
painter->fillRect(size, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RBMovable::paint(painter, option, widget);
|
||||||
|
}
|
||||||
|
|
||||||
|
void RBProgressBar::saveGeometry()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,12 +25,13 @@
|
||||||
#include <QGraphicsItem>
|
#include <QGraphicsItem>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
|
|
||||||
|
#include "rbmovable.h"
|
||||||
#include "rbrenderinfo.h"
|
#include "rbrenderinfo.h"
|
||||||
#include "rbviewport.h"
|
#include "rbviewport.h"
|
||||||
#include "devicestate.h"
|
#include "devicestate.h"
|
||||||
#include "skin_parser.h"
|
#include "skin_parser.h"
|
||||||
|
|
||||||
class RBProgressBar : public QGraphicsItem
|
class RBProgressBar : public RBMovable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RBProgressBar(RBViewport* parent, const RBRenderInfo& info,
|
RBProgressBar(RBViewport* parent, const RBRenderInfo& info,
|
||||||
|
@ -41,6 +42,9 @@ public:
|
||||||
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
||||||
QWidget *widget);
|
QWidget *widget);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void saveGeometry();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPixmap* bitmap;
|
QPixmap* bitmap;
|
||||||
QColor color;
|
QColor color;
|
||||||
|
|
|
@ -1065,6 +1065,9 @@ double ParseTreeNode::findConditionalTime(ParseTreeNode *conditional,
|
||||||
{
|
{
|
||||||
int child = conditional->evalTag(info, true,
|
int child = conditional->evalTag(info, true,
|
||||||
conditional->children.count()).toInt();
|
conditional->children.count()).toInt();
|
||||||
|
if(child >= conditional->children.count())
|
||||||
|
child = conditional->children.count() - 1;
|
||||||
|
|
||||||
return findBranchTime(conditional->children[child], info);
|
return findBranchTime(conditional->children[child], info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue