X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=inline;f=src%2Fgui%2Fimagedelegate.cpp;h=b5dc508d8316f966584dbb344f6b866aa3ca5342;hb=47c26d5d9daba6072bc580029e711292393d3158;hp=70879151f081dc3d4f47a8cbdacf288fd94f63db;hpb=25cc16d819c81e08d2e21b57720dd4ea08ae9e25;p=virtualjaguar diff --git a/src/gui/imagedelegate.cpp b/src/gui/imagedelegate.cpp index 7087915..b5dc508 100644 --- a/src/gui/imagedelegate.cpp +++ b/src/gui/imagedelegate.cpp @@ -72,12 +72,29 @@ The foreground of the item (the circle representing a pixel) must be rendered us option.rect.y() + option.rect.height()/2 - radius, 2*radius, 2*radius)); #else // painter->drawPixmap(option.rect.x()+8, option.rect.y()+8, 200, 94, QPixmap(":/res/labels/rayman.jpg")); - painter->drawPixmap(option.rect.x(), option.rect.y(), 488/2, 395/2, QPixmap(":/res/cart-blank.png")); // painter->drawPixmap(option.rect.x()+13, option.rect.y()+51, 433/2, 203/2, QPixmap(":/res/labels/rayman.jpg")); - painter->drawPixmap(option.rect.x()+14, option.rect.y()+50, 433/2, 203/2, QPixmap(":/res/label-blank.png")); -//Need to query the model for the data we're supposed to draw here... +// painter->drawPixmap(option.rect.x(), option.rect.y(), 488/2, 395/2, QPixmap(":/res/cart-blank.png")); + painter->drawPixmap(option.rect.x(), option.rect.y(), 488/4, 395/4, QPixmap(":/res/cart-blank.png")); unsigned long i = index.model()->data(index, Qt::DisplayRole).toUInt(); - painter->drawText(17, 73, QString(romList[i].name)); + + if (romList[i].file[0] == 0) + { +// painter->drawPixmap(option.rect.x()+14, option.rect.y()+50, 433/2, 203/2, QPixmap(":/res/label-blank.png")); + painter->drawPixmap(option.rect.x()+7, option.rect.y()+25, 433/4, 203/4, QPixmap(":/res/label-blank.png")); +//Need to query the model for the data we're supposed to draw here... +// painter->drawText(17, 73, QString(romList[i].name)); +// painter->setPen(Qt::white); + painter->setPen(QColor(255, 128, 0, 255)); +// painter->drawText(QRect(option.rect.x()+20, option.rect.y()+73, 196, 70), Qt::TextWordWrap | Qt::AlignHCenter, QString(romList[i].name)); + painter->drawText(QRect(option.rect.x()+10, option.rect.y()+36, 196/2, 70/2), Qt::TextWordWrap | Qt::AlignHCenter, QString(romList[i].name)); + } + else + { + QString filename(romList[i].file); + filename.prepend("./label/"); + QImage img(filename); + painter->drawImage(QRect(option.rect.x()+7, option.rect.y()+25, 433/4, 203/4), img); + } //26x100 #endif painter->restore(); @@ -99,7 +116,8 @@ QSize ImageDelegate::sizeHint(const QStyleOptionViewItem & /* option */, const Q // 200x94 is shrunk dimension... // return QSize(100, 47); // return QSize(216, 110); - return QSize(488/2, 395/2); +// return QSize(488/2, 395/2); + return QSize(488/4, 395/4); } /*