ginebra/animations/fadeanimator.cpp
changeset 3 0954f5dd2cd0
parent 1 b0dd75e285d2
child 4 d5cdb6bc139d
equal deleted inserted replaced
1:b0dd75e285d2 3:0954f5dd2cd0
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "fadeanimator.h"
       
    20 #include "../chromesnippet.h"
       
    21 #include <QList>
       
    22 
       
    23 FadeAnimator::FadeAnimator(ChromeSnippet* m_snippet) 
       
    24   : VisibilityAnimator(m_snippet),
       
    25     m_minOpacity(0.1)
       
    26 {
       
    27 }
       
    28 
       
    29 FadeAnimator::~FadeAnimator()
       
    30 {
       
    31 }
       
    32 
       
    33 void FadeAnimator::updateVisibility(qreal step)
       
    34 {
       
    35   //qDebug() << step;
       
    36   qreal o = 1.0 - step;
       
    37   if(o > m_minOpacity){
       
    38     m_snippet->setOpacity(o);
       
    39   }
       
    40 }