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

List:       kde-commits
Subject:    kdeartwork/styles/plastik
From:       Sandro Giessl <sandro () giessl ! com>
Date:       2004-05-12 20:28:15
Message-ID: 20040512202815.9274FC23 () office ! kde ! org
[Download RAW message or body]

CVS commit by giessl: 

ListView decoration:
- Edges of expanders aren't rounded anymore.
- Lighter branch lines (cg.mid() instead of the cg.text() default).


  M +80 -1     plastik.cpp   1.75


--- kdeartwork/styles/plastik/plastik.cpp  #1.74:1.75
@@ -47,4 +47,5 @@
 #include <qcheckbox.h>
 #include <qcombobox.h>
+#include <qcleanuphandler.h>
 #include <qlineedit.h>
 #include <qlistbox.h>
@@ -1376,5 +1377,5 @@ void PlastikStyle::drawKStylePrimitive(K
             int centery = r.y() + r.height()/2;
 
-            renderContour(p, r, cg.base(), cg.mid().dark(115) );
+            renderContour(p, r, cg.base(), cg.dark(), Draw_Left|Draw_Right|Draw_Top|Draw_Bottom );
 
             // plus or minus
@@ -1387,4 +1388,82 @@ void PlastikStyle::drawKStylePrimitive(K
         }
 
+    // copied and slightly modified from KStyle.
+    case KPE_ListViewBranch: {
+        // Typical Windows style listview branch element (dotted line).
+
+        static QBitmap *verticalLine = 0, *horizontalLine = 0;
+        static QCleanupHandler<QBitmap> qlv_cleanup_bitmap;
+
+        // Create the dotline pixmaps if not already created
+        if ( !verticalLine )
+        {
+            // make 128*1 and 1*128 bitmaps that can be used for
+            // drawing the right sort of lines.
+            verticalLine   = new QBitmap( 1, 129, true );
+            horizontalLine = new QBitmap( 128, 1, true );
+            QPointArray a( 64 );
+            QPainter p2;
+            p2.begin( verticalLine );
+
+            int i;
+            for( i=0; i < 64; i++ )
+                a.setPoint( i, 0, i*2+1 );
+            p2.setPen( color1 );
+            p2.drawPoints( a );
+            p2.end();
+            QApplication::flushX();
+            verticalLine->setMask( *verticalLine );
+
+            p2.begin( horizontalLine );
+            for( i=0; i < 64; i++ )
+                a.setPoint( i, i*2+1, 0 );
+            p2.setPen( color1 );
+            p2.drawPoints( a );
+            p2.end();
+            QApplication::flushX();
+            horizontalLine->setMask( *horizontalLine );
+
+            qlv_cleanup_bitmap.add( &verticalLine );
+            qlv_cleanup_bitmap.add( &horizontalLine );
+        }
+
+        p->setPen( cg.mid() );
+
+        if (flags & Style_Horizontal)
+        {
+            int point = r.x();
+            int other = r.y();
+            int end = r.x()+r.width();
+            int thickness = r.height();
+
+            while( point < end )
+            {
+                int i = 128;
+                if ( i+point > end )
+                    i = end-point;
+                p->drawPixmap( point, other, *horizontalLine, 0, 0, i, thickness );
+                point += i;
+            }
+
+        } else {
+            int point = r.y();
+            int other = r.x();
+            int end = r.y()+r.height();
+            int thickness = r.width();
+            int pixmapoffset = (flags & Style_NoChange) ? 0 : 1;        // ### Hackish
+
+            while( point < end )
+            {
+                int i = 128;
+                if ( i+point > end )
+                    i = end-point;
+                p->drawPixmap( other, point, *verticalLine, 0, pixmapoffset, thickness, i );
+                point += i;
+            }
+        }
+
+        break;
+    }
+
         default:
             KStyle::drawKStylePrimitive(kpe, p, widget, r, cg, flags, opt);


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

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