~ubuntu-branches/ubuntu/wily/oxygen/wily

« back to all changes in this revision

Viewing changes to kstyle/transitions/oxygentransitionwidget.cpp

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell, Scarlett Clark, Jonathan Riddell
  • Date: 2015-08-10 23:18:51 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20150810231851-wtw33zvkigya4f7t
Tags: 4:5.3.95-0ubuntu1
[ Scarlett Clark ]
* Vivid backport. 

[ Jonathan Riddell ]
* new upstream beta release

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    //________________________________________________
45
45
    TransitionWidget::TransitionWidget( QWidget* parent, int duration ):
46
46
        QWidget( parent ),
47
 
        _flags( None ),
48
 
        _animation( new Animation( duration, this ) ),
49
 
        _opacity( 0 )
 
47
        _animation( new Animation( duration, this ) )
50
48
    {
51
49
 
52
50
        // background flags
53
 
        setAttribute(Qt::WA_NoSystemBackground );
 
51
        setAttribute( Qt::WA_NoSystemBackground );
54
52
        setAutoFillBackground( false );
55
53
 
56
54
        // setup animation
59
57
        _animation.data()->setTargetObject( this );
60
58
        _animation.data()->setPropertyName( "opacity" );
61
59
 
62
 
        // setup connections
63
 
        connect( _animation.data(), SIGNAL(finished()), SIGNAL(finished()) );
 
60
        // hide when animation is finished
 
61
        connect( _animation.data(), SIGNAL(finished()), SLOT(hide()) );
64
62
 
65
63
    }
66
64
 
102
100
    }
103
101
 
104
102
    //________________________________________________
 
103
    bool TransitionWidget::event( QEvent* event )
 
104
    {
 
105
        switch( event->type() )
 
106
        {
 
107
            case QEvent::MouseButtonPress:
 
108
            case QEvent::MouseButtonRelease:
 
109
            case QEvent::KeyPress:
 
110
            case QEvent::KeyRelease:
 
111
            endAnimation();
 
112
            hide();
 
113
            event->ignore();
 
114
            return false;
 
115
 
 
116
            default: return QWidget::event( event );
 
117
        }
 
118
 
 
119
    }
 
120
 
 
121
    //________________________________________________
105
122
    void TransitionWidget::paintEvent( QPaintEvent* event )
106
123
    {
107
124