Exemplo n.º 1
0
static void
setCurrentRect (CompScreen *s)
{
    GRID_SCREEN (s);

    gs->anim.currentRect.x = applyProgress (gs->anim.targetRect.x,
                                            gs->anim.fromRect.x,
                                            gs->anim.progress);
    gs->anim.currentRect.width = applyProgress (gs->anim.targetRect.width,
                                 gs->anim.fromRect.width,
                                 gs->anim.progress);
    gs->anim.currentRect.y = applyProgress (gs->anim.targetRect.y,
                                            gs->anim.fromRect.y,
                                            gs->anim.progress);
    gs->anim.currentRect.height = applyProgress (gs->anim.targetRect.height,
                                  gs->anim.fromRect.height,
                                  gs->anim.progress);
}
Exemplo n.º 2
0
ProgressItem::ProgressItem(QString message, bool isLoading, QGraphicsScene * scene) :
    message(message), isLoading(isLoading), scene(scene), progress(0)
{
    // CHECK FIXME Gideon
    // items = new QGraphicsItemGroup(0,scene);
    items = new QGraphicsItemGroup(0);
    connect(this, SIGNAL(visibleChanged()), SLOT(visiblityChanged()));

    // Spinner
    spinner = new SpinnerItem(80, 10, QColor(255,153,0));
    this->connect(spinner->timer, SIGNAL(timeout()), this, SLOT(applyProgress()));
    int spinnerX = (scene->width() * 0.5) - (spinner->boundingRect().width() * 0.5);
    int spinnerY = (scene->height() * 0.5) - (spinner->boundingRect().height() * 0.5);
    spinner->setPos( spinnerX, spinnerY );
    items->addToGroup(spinner);

	items->setZValue(10000);
	this->setZValue(100000);

    isSmoothAnimation = false;

    this->setVisible(false);
	scene->addItem(this);
}