[prev in list] [next in list] [prev in thread] [next in thread]
List: kwin
Subject: Re: Magic Lamp Minimize Effect
From: Martin Graesslin <ubuntu () martin-graesslin ! com>
Date: 2008-08-03 17:24:34
Message-ID: 200808031924.42455.ubuntu () martin-graesslin ! com
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
[Attachment #4 (multipart/mixed)]
Am Sonntag, 3. August 2008 18:15:36 schrieb Sebastian Kügler:
> On Wednesday 30 July 2008 10:01:31 Martin Graesslin wrote:
> > I started to work on the magic lamp minimize effect as wished in bug
> > #167387. (That happens if you are bored in the evening and don't want to
> > work on cube ;-) )
> >
> > So here is the first result. As always I'm glad about feedback.
>
> After some time of using it, I still love it (will keep it as minimize
> effect, I think :)).
Quite a point where I start to miss that I'm now using packaged KDE and not
trunk as work environment any more.
>
> Right now the minization is done into a fixed size rect behind the taskbar.
> It would be nice if the effect used the width of the taskbar item to scale
> down to. The minimize effect does the same, so basically the window is
> scaled from window size to taskbaritem size. Did you try that, did it work
> visually?
Actually I had not tried. But here's the patch. It's hard to say which version
looks better. Personally I don't mind, but the first version had some glitches
(hardly visible in that speed).
["magiclamp.diff" (text/x-patch)]
diff --git a/effects/magiclamp.cpp b/effects/magiclamp.cpp
index 14b0876..20e9af9 100644
--- a/effects/magiclamp.cpp
+++ b/effects/magiclamp.cpp
@@ -104,14 +104,14 @@ void MagicLampEffect::paintWindow( EffectWindow* w, int mask, \
QRegion region, Wi
((quadFactor*quadFactor*quadFactor)/(geo.height()*geo.height()*geo.height()));
// top and bottom progress is the factor which defines how far the x \
values have to be changed
// factor is the current moved y value diveded by the distance between \
icon and window
- float topProgress = qMin( yOffsetTop/(icon.y() - \
geo.y()-(float)(quad[0].y()/geo.height()*geo.height())), 1.0f );
- float bottomProgress = qMin( yOffsetBottom/(icon.y() - \
geo.y()-(float)(quad[2].y()/geo.height()*geo.height())), 1.0f ); + float \
topProgress = qMin( yOffsetTop/(icon.y()+icon.height() - \
geo.y()-(float)(quad[0].y()/geo.height()*geo.height())), 1.0f ); + float \
bottomProgress = qMin( yOffsetBottom/(icon.y()+icon.height() - \
geo.y()-(float)(quad[2].y()/geo.height()*geo.height())), 1.0f );
// x values are moved towards the center of the icon
- quad[0].setX( (icon.x() + icon.width()*0.5 - (quad[0].x() + \
geo.x()))*topProgress + quad[0].x() );
- quad[1].setX( (icon.x() + icon.width()*0.5 - (quad[1].x() + \
geo.x()))*topProgress + quad[1].x() );
- quad[2].setX( (icon.x() + icon.width()*0.5 - (quad[2].x() + \
geo.x()))*bottomProgress + quad[2].x() );
- quad[3].setX( (icon.x() + icon.width()*0.5 - (quad[3].x() + \
geo.x()))*bottomProgress + quad[3].x() ); + quad[0].setX( (icon.x() + \
icon.width()*(quad[0].x()/geo.width()) - (quad[0].x() + geo.x()))*topProgress + \
quad[0].x() ); + quad[1].setX( (icon.x() + \
icon.width()*(quad[1].x()/geo.width()) - (quad[1].x() + geo.x()))*topProgress + \
quad[1].x() ); + quad[2].setX( (icon.x() + \
icon.width()*(quad[2].x()/geo.width()) - (quad[2].x() + geo.x()))*bottomProgress + \
quad[2].x() ); + quad[3].setX( (icon.x() + \
icon.width()*(quad[3].x()/geo.width()) - (quad[3].x() + geo.x()))*bottomProgress + \
quad[3].x() );
quad[0].setY( quad[0].y() + yOffsetTop );
quad[1].setY( quad[1].y() + yOffsetTop );
["signature.asc" (application/pgp-signature)]
_______________________________________________
kwin mailing list
kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic