[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/ksmserver
From:       Benoit Walter <b.walter () free ! fr>
Date:       2004-02-19 11:55:32
Message-ID: 20040219115532.09B27996E () office ! kde ! org
[Download RAW message or body]

CVS commit by bwalter: 

Applying a new background effect when logging out (asynchronously to
avoid blocking the GUI).
I hope it won't be a reason to logout more frequently :-)


  M +17 -9     shutdown.cpp   1.43
  M +4 -2      shutdown.h   1.10


--- kdebase/ksmserver/shutdown.cpp  #1.42:1.43
@@ -17,5 +17,4 @@ Copyright (C) 2000 Matthias Ettrich <ett
 #include <qlabel.h>
 #include <qvbox.h>
-#include <qpainter.h>
 #include <qtimer.h>
 #include <qstyle.h>
@@ -33,4 +32,6 @@ Copyright (C) 2000 Matthias Ettrich <ett
 #include <kwin.h>
 #include <kuser.h>
+#include <kpixmap.h>
+#include <kpixmapeffect.h>
 
 #include <sys/types.h>
@@ -46,18 +47,25 @@ KSMShutdownFeedback * KSMShutdownFeedbac
 
 KSMShutdownFeedback::KSMShutdownFeedback()
- : QWidget( 0L, "feedbackwidget", WType_Popup )
+ : QWidget( 0L, "feedbackwidget", WType_Popup ),
+   m_currentY( 0 )
 {
     setBackgroundMode( QWidget::NoBackground );
     setGeometry( QApplication::desktop()->geometry() );
+    QTimer::singleShot( 1, this, SLOT( slotPaintEffect() ) );
 }
 
 
-void KSMShutdownFeedback::paintEvent( QPaintEvent* )
+void KSMShutdownFeedback::slotPaintEffect()
 {
-    QPainter p;
-    QBrush b( Qt::Dense4Pattern );
-    p.begin( this );
-    p.fillRect( rect(), b);
-    p.end();
+    if ( m_currentY >= height() )
+        return;
+
+    KPixmap pixmap;
+    pixmap = QPixmap::grabWindow( qt_xrootwin(), 0, m_currentY, width(), 10 );
+    pixmap = KPixmapEffect::fade( pixmap, 0.4, Qt::black );
+    pixmap = KPixmapEffect::toGray( pixmap, true );
+    bitBlt( this, 0, m_currentY, &pixmap );
+    m_currentY += 10;
+    QTimer::singleShot( 1, this, SLOT( slotPaintEffect() ) );
 }
 

--- kdebase/ksmserver/shutdown.h  #1.9:1.10
@@ -30,8 +29,11 @@ protected:
     ~KSMShutdownFeedback() {}
 
+private slots:
+    void slotPaintEffect();
+
 private:
-    void paintEvent( QPaintEvent* );
     static KSMShutdownFeedback * s_pSelf;
     KSMShutdownFeedback();
+    int m_currentY;
 };
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic