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

List:       kde-commits
Subject:    KDE/kdegraphics/okular/ui
From:       Eike Hein <hein () kde ! org>
Date:       2011-02-09 21:24:09
Message-ID: 20110209212409.C22DAAC8C0 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1219635 by hein:

Fix glitches in page outline drap shadow rendering.

* Fixed the small corner areas outside the outline that don't
  belong to the drop shadow being filled in with a different color
  than the viewport outside the page rects, causing well-visible
  artifacts.
* Fixed the drop shadow not being blended against the colorscheme-
  aware viewport background color but rather the fixed value of
  Qt::gray.
* Made the drop shadow a tad lighter overall to preserve the same
  visual result, seeing as how the default color scheme leads to
  a darker viewport background color than Qt::gray.


 M  +6 -6      pageview.cpp  


--- trunk/KDE/kdegraphics/okular/ui/pageview.cpp #1219634:1219635
@@ -2412,6 +2412,8 @@
 
 void PageView::drawDocumentOnPainter( const QRect & contentsRect, QPainter * p )
 {
+    QColor backColor = viewport()->palette().color( QPalette::Dark );
+
     // when checking if an Item is contained in contentsRect, instead of
     // growing PageViewItems rects (for keeping outline into account), we
     // grow the contentsRect
@@ -2449,15 +2451,15 @@
             p->drawRect( -1, -1, itemWidth + 1, itemHeight + 1 );
             // draw bottom/right gradient
             static int levels = 2;
-            int r = QColor(Qt::gray).red() / (levels + 2),
-                g = QColor(Qt::gray).green() / (levels + 2),
-                b = QColor(Qt::gray).blue() / (levels + 2);
+            int r = backColor.red() / (levels + 2) + 6,
+                g = backColor.green() / (levels + 2) + 6,
+                b = backColor.blue() / (levels + 2) + 6;
             for ( int i = 0; i < levels; i++ )
             {
                 p->setPen( QColor( r * (i+2), g * (i+2), b * (i+2) ) );
                 p->drawLine( i, i + itemHeight + 1, i + itemWidth + 1, i + itemHeight + 1 );
                 p->drawLine( i + itemWidth + 1, i, i + itemWidth + 1, i + itemHeight );
-                p->setPen( Qt::gray );
+                p->setPen( backColor );
                 p->drawLine( -1, i + itemHeight + 1, i - 1, i + itemHeight + 1 );
                 p->drawLine( i + itemWidth + 1, -1, i + itemWidth + 1, i - 1 );
             }
@@ -2481,8 +2483,6 @@
     // fill with background color the unpainted area
     const QVector<QRect> &backRects = remainingArea.rects();
     int backRectsNumber = backRects.count();
-    // the previous color here was Qt::gray
-    QColor backColor = viewport()->palette().color( QPalette::Dark );
     for ( int jr = 0; jr < backRectsNumber; jr++ )
         p->fillRect( backRects[ jr ], backColor );
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

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