~ubuntu-branches/ubuntu/gutsy/kdebase-workspace/gutsy

« back to all changes in this revision

Viewing changes to kwin/effects/dialogparent.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-10-11 14:04:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071011140448-v0eb7lxbb24zagca
Tags: 3.94.0-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
void DialogParentEffect::prePaintWindow( EffectWindow* w, WindowPrePaintData& data, int time )
19
19
    {
20
20
    // How long does it take for the effect to get it's full strength (in ms)
21
 
    const float changeTime = 200;
 
21
    const double changeTime = 200;
22
22
 
23
23
    // Check if this window has a modal dialog and change the window's
24
24
    //  effect's strength accordingly
26
26
    if( hasDialog )
27
27
        {
28
28
        // Increase effect strength of this window
29
 
        effectStrength[w] = qMin(1.0f, effectStrength[w] + time/changeTime);
 
29
        effectStrength[w] = qMin(1.0, effectStrength[w] + time/changeTime);
30
30
        }
31
31
    else
32
32
        {
33
 
        effectStrength[w] = qMax(0.0f, effectStrength[w] - time/changeTime);
 
33
        effectStrength[w] = qMax(0.0, effectStrength[w] - time/changeTime);
34
34
        }
35
35
 
36
36
    // Call the next effect
39
39
 
40
40
void DialogParentEffect::paintWindow( EffectWindow* w, int mask, QRegion region, WindowPaintData& data )
41
41
    {
42
 
    float s = effectStrength[w];
 
42
    double s = effectStrength[w];
43
43
    if(s > 0.0f)
44
44
        {
45
45
        // Brightness will be within [1.0; 0.6]
54
54
 
55
55
void DialogParentEffect::postPaintWindow( EffectWindow* w )
56
56
    {
57
 
    float s = effectStrength[w];
 
57
    double s = effectStrength[w];
58
58
 
59
59
    // If strength is between 0 and 1, the effect is still in progress and the
60
60
    //  window has to be repainted during the next pass