From kde-commits Sun Oct 17 17:20:13 2004 From: Dario Massarin Date: Sun, 17 Oct 2004 17:20:13 +0000 To: kde-commits Subject: make_it_cool: kdenetwork/kget Message-Id: <20041017172013.7D95316C49 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=109803363105882 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 #include +#include class KListView; --- kdenetwork/kget/views/mainview.cpp #1.1.2.5:1.1.2.6 @@ -14,4 +14,6 @@ #include #include +#include +#include #include @@ -20,4 +22,5 @@ #include #include +#include #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;