15 #include <qfontmetrics.h> 16 #include <qapplication.h> 24 #include "../config.h" 25 #include "../backend/photo.h" 26 #include "../backend/tools/guiTools.h" 30 Q3IconViewItem( parent, QString(
""), QPixmap(phto->getThumbnailFilename()) )
38 QFontMetrics fm( qApp->font() );
63 Q3IconViewItem::setPixmap( p, redraw );
79 QColor offWhite( 255, 255, 255 );
80 QColor darkBlue(35, 75, 139);
84 QRect paperRect( x(), y(),
88 paperColor = darkBlue;
90 paperColor = offWhite;
91 p->fillRect( paperRect, QBrush( paperColor ) );
99 int align = Qt::AlignLeft | Qt::AlignTop | Qt::TextWrapAnywhere;
101 p->setPen( Qt::white );
103 p->setPen( Qt::black );
104 p->drawText( x() + textRect().x() + 1, y() + textRect().y() + 1,
114 QSize newSize = r.size().expandedTo(buffer.size() );
115 buffer.resize(newSize);
116 buffer.fill( Qt::white );
119 QPainter bufferPainter(&buffer);
120 bufferPainter.translate( -r.x(), -r.y() );
123 paint(&bufferPainter);
129 bufferPainter.drawPixmap( photoInfoRect, * (((
Window*) qApp->mainWidget())->photoInfo) );
133 QPixmap* shadowBL, *shadowB, *shadowBR, *shadowR, *shadowTR;
143 shadowRect.setRight( shadowRect.left() +
PHOTO_SHADOW );
145 shadowRect.setBottom( shadowRect.top() +
PHOTO_SHADOW );
146 bufferPainter.drawPixmap( shadowRect, *shadowBL );
148 shadowRect.setLeft( shadowRect.right() + 1 );
150 bufferPainter.drawPixmap( shadowRect, *shadowB );
152 shadowRect.setLeft( shadowRect.right() + 1 );
153 shadowRect.setRight( shadowRect.left() +
PHOTO_SHADOW );
154 bufferPainter.drawPixmap( shadowRect, *shadowBR );
156 shadowRect.setBottom( shadowRect.top() - 1 );
158 bufferPainter.drawPixmap( shadowRect, *shadowR );
160 shadowRect.setBottom( shadowRect.top() - 1 );
162 bufferPainter.drawPixmap( shadowRect, *shadowTR );
165 p->drawPixmap( x(), y(), buffer );
177 if( pos().y() > (i->pos().y() +
height()) ||
179 pos().y() >= i->pos().y() &&
180 pos().x() >= i->pos().x()
190 QRect pr = pixmapRect();
205 QFontMetrics fm( qApp->font() );
210 tr.setBottom( tr.top() + 0*fm.leading() + 1*fm.height() );
216 setItemRect( QRect( itemLeft, itemTop, itemW, itemH ) );
227 QFontMetrics fm( qApp->font() );
229 photoInfoRect.setRight( photoInfoRect.left() + fm.height() );
231 photoInfoRect.setBottom( photoInfoRect.top() + fm.height() );
243 xpos-= iconView()->contentsX();
244 ypos-= iconView()->contentsY();
251 QPoint viewportTL = iconView()->viewport()->mapToGlobal( QPoint(0,0) );
252 xpos+= viewportTL.x();
253 ypos+= viewportTL.y();
255 return QPoint(xpos,ypos);
A photo consists of a full size image, a smaller slide show image, a very small thumbnail image...
Top level widget, encapsulates the title widget, the layout widget, and the toolbar widget...
QString getThumbnailFilename()
Gets the thumbnail filename.
QString getDescription()
Gets the description.