Beispiel #1
0
//-----------------------------------------------------------------------------
//!
//-----------------------------------------------------------------------------
void tAbstractSideBar::AnimateTo( int offset )
{
    if( m_pAnimationTimer == 0 )
    {
        m_pAnimationTimer = new tTimeLineDecelerate( 300, this );
        m_pAnimationTimer->setFrameRange( 0, m_cNumberOfAnimationSteps );
        m_pAnimationTimer->setUpdateInterval( 20 );
        Connect( m_pAnimationTimer, SIGNAL( finished() ), this, SLOT( OnAnimationFinished() ) );
    }

    m_pAnimationTimer->stop();

    if( m_pAnimationController == 0 )
    {
        m_pAnimationController = new QGraphicsItemAnimation( this );
        m_pAnimationController->setTimeLine( m_pAnimationTimer );
        m_pAnimationController->setItem( this );
    }

    //m_SideBarPosition = pos;

    // flip for RHS
    offset *= m_Orientation == eOR_Leftside ? 1 : -1;

    // always animate from the current position
    m_pAnimationController->setPosAt( 0, this->pos() );
    m_pAnimationController->setPosAt( 1, m_OriginPos + QPointF( offset, 0 ) );

    m_pAnimationTimer->start();
    m_IsAnimating = true;
    emit Animating( true );
}
RocketOfflineLobby::RocketOfflineLobby(RocketPlugin *plugin, QWidget *parent) :
    QWidget(parent),
    plugin_(plugin),
    framework_(plugin->GetFramework()),
    animation_(new RocketAnimationEngine(this)),
    retryTimer_(0),
    retrySeconds_(3),
    actualSeconds_(retrySeconds_),
    preventShow_(false),
    opacity_(1.0)
{
    ui_.setupUi(this);
    UiProxyWidget *proxy = framework_->Ui()->AddWidgetToScene(this, Qt::Widget);
    proxy->setZValue(100000);

    setGeometry(0, 0, framework_->Ui()->GraphicsView()->width(), framework_->Ui()->GraphicsView()->height());

    retryTimer_ = new QTimer();
    retryTimer_->setInterval(1000);

    QPixmap presisImage(":/images/icon-presis.png");
    RocketOfflineLobbyButton *presisButton = new RocketOfflineLobbyButton("Presis", "Rocket's presentations tool", presisImage);
    AddButton(presisButton);

    QPixmap settingsImage(":/images/icon-settings2.png");
    RocketOfflineLobbyButton *settingsButton = new RocketOfflineLobbyButton("Settings", "Change Rocket settings", settingsImage);
    AddButton(settingsButton);

    animation_->Initialize(proxy, false, false, false, true, 500, QEasingCurve::OutCubic);
    connect(animation_->opacity, SIGNAL(finished()), SLOT(OnAnimationFinished()));

    connect(retryTimer_, SIGNAL(timeout()), this, SLOT(Countdown()));
    connect(ui_.retryButton, SIGNAL(clicked()), this, SLOT(OnRetry()));
    connect(ui_.exitButton, SIGNAL(clicked()), framework_, SLOT(Exit()), Qt::QueuedConnection);
    connect(framework_->Ui()->GraphicsView(), SIGNAL(WindowResized(int, int)), this, SLOT(OnResize(int, int)));
    connect(plugin_->Backend(), SIGNAL(AuthCompleted(const Meshmoon::User &)), this, SLOT(OnAuthenticated()));

    connect(settingsButton, SIGNAL(Clicked()), this, SLOT(Hide()));
    connect(presisButton, SIGNAL(Clicked()), this, SLOT(Hide()));
    connect(settingsButton, SIGNAL(Clicked()), plugin_->Lobby(), SIGNAL(EditSettingsRequest()));
    connect(presisButton, SIGNAL(Clicked()), plugin_->Lobby(), SIGNAL(OpenPresisRequest()));
}
Beispiel #3
0
void UUserWidget::OnAnimationFinishedPlaying( UUMGSequencePlayer& Player )
{
	OnAnimationFinished( Player.GetAnimation() );
	StoppedSequencePlayers.Add( &Player );
}