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

List:       kde-commits
Subject:    make_it_cool: kdenetwork/kget
From:       Dario Massarin <nekkar () libero ! it>
Date:       2004-10-17 17:20:13
Message-ID: 20041017172013.7D95316C49 () office ! kde ! org
[Download RAW message or body]

CVS commit by dario: 

Some experiments on the mainview in order to achieve e better look&feel


  M +4 -1      group.cpp   1.1.2.4
  M +1 -0      panels/groupspanel.cpp   1.1.2.3
  M +1 -0      panels/groupspanel.h   1.1.2.3
  M +16 -3     views/mainview.cpp   1.1.2.6


--- kdenetwork/kget/group.cpp  #1.1.2.3:1.1.2.4
@@ -49,5 +49,8 @@ void Group::updatePercent()
 {
     kdDebug() << "updatePercent" << gInfo.processedSize << " / " << gInfo.totalSize << endl;
+    if(gInfo.totalSize != 0)
     gInfo.percent = 100 * gInfo.processedSize / gInfo.totalSize;
+    else
+        gInfo.percent = 0;
 }    
 

--- kdenetwork/kget/panels/groupspanel.cpp  #1.1.2.2:1.1.2.3
@@ -44,4 +44,5 @@ void GroupItem::updateContents(bool upda
     if(updateAll)
     {
+        setPixmap(0, SmallIcon("package") );
         setText(0, info.name);
         setText(2, KIO::convertSize(info.totalSize));

--- kdenetwork/kget/panels/groupspanel.h  #1.1.2.2:1.1.2.3
@@ -18,4 +18,5 @@
 #include <qmap.h>
 #include <klistview.h>
+#include <kiconloader.h>
 
 class KListView;

--- kdenetwork/kget/views/mainview.cpp  #1.1.2.5:1.1.2.6
@@ -14,4 +14,6 @@
 #include <qpalette.h>
 #include <qfont.h>
+#include <qimage.h>
+#include <qpixmap.h>
 
 #include <kdebug.h>
@@ -20,4 +22,5 @@
 #include <kiconloader.h>
 #include <kio/global.h>
+#include <kimageeffect.h>
 
 #include "mainview.h"
@@ -47,7 +50,15 @@ void MainViewGroupItem::paintCell(QPaint
     //QListViewItem::paintCell(p, cg, column, width, align);
     
-    //p->fillRect(0,0,width, height(), QColor(174, 174, 220).dark(120));
+/*    QPixmap * topLeftPix = new QPixmap(
+        KImageEffect::gradient( QSize( width, height() ),
+        cg.brush(QColorGroup::Background).color(), 
+        cg.brush(QColorGroup::Background).color().light(110),
+        KImageEffect::VerticalGradient ) );*/
+        
+
+//     p->drawPixmap(0,0, *topLeftPix);
     p->fillRect(0,0,width, height(), cg.brush(QColorGroup::Background));
     
+   
     switch (column)
     {
@@ -60,5 +71,8 @@ void MainViewGroupItem::paintCell(QPaint
             f.setBold(true);
             p->setFont(f);
-            p->drawText(0,0,width, height(), Qt::AlignVCenter, 
+            p->setPen(QPen(cg.brush(QColorGroup::Background).color().dark(110),2));
+            p->drawRoundRect(0,0,width, height(), 15, 100);
+            p->setPen(cg.brush(QColorGroup::Foreground).color());
+            p->drawText(0,0,width, height(), Qt::AlignCenter, 
                     group->info().name);
             break;


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

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