~ubuntu-branches/ubuntu/jaunty/digikam/jaunty

« back to all changes in this revision

Viewing changes to digikam/albumiconitem.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Luka Renko
  • Date: 2009-01-21 21:55:15 UTC
  • mfrom: (1.2.18 upstream)
  • Revision ID: james.westby@ubuntu.com-20090121215515-lry0s2pdep289o3u
Tags: 2:0.10.0~rc1-0ubuntu1
* New upstream release (release candididate 1)
* rules:
  - Simplify by including standard class/kde4.mk
* control:
  - Build-Depends on quilt (default patch system of kde4.mk)
  - Bump Standards-Version to 3.8.0
  - Bump debhelper dependancy to 7
  - Add ${misc:Depends} to make lintian happy
* {digikam|showfoto}.install:
  - Update icon paths
  - Do not package oxygen and apps icons: provided by kde-icons-oxygen
* patches/01-kubuntu-fix-armel.patch:
  - Fix cut&paste bug in the patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
236
236
    return pixmapRect;
237
237
}
238
238
 
 
239
QRect AlbumIconItem::clickToRateRect()
 
240
{
 
241
    QRect ratingRect = d->view->itemRatingRect();
 
242
    QRect r          = rect();
 
243
 
 
244
    ratingRect.translate(r.x(), r.y());
 
245
    return ratingRect;
 
246
}
 
247
 
239
248
void AlbumIconItem::paintItem(QPainter *p)
240
249
{
241
250
    QRect r;
274
283
        p->drawPixmap(d->tightPixmapRect.x()-3, d->tightPixmapRect.y()-3, borderPix);
275
284
 
276
285
        p->restore();
277
 
 
278
286
    }
279
287
    else
280
288
    {
285
293
    if (settings->getIconShowRating())
286
294
    {
287
295
        r = d->view->itemRatingRect();
288
 
 
289
 
        int rating = d->info.rating();
290
 
 
291
 
        if (rating > 0 && rating <=5)
292
 
        {
293
 
            QPixmap ratingPixmap = d->view->ratingPixmap(rating, isSelected());
294
 
            p->drawPixmap(r, ratingPixmap);
295
 
        }
 
296
        QPixmap ratingPixmap;
 
297
 
 
298
        if (!editRating())
 
299
            ratingPixmap = d->view->ratingPixmap(d->info.rating(), isSelected());
 
300
        else
 
301
            ratingPixmap = d->view->ratingPixmap(-1, isSelected());
 
302
 
 
303
        p->drawPixmap(r, ratingPixmap);
296
304
    }
297
305
 
298
306
    if (settings->getIconShowName())
388
396
    }
389
397
}
390
398
 
 
399
void AlbumIconItem::setRating(int rating)
 
400
{
 
401
    d->info.setRating(rating);
 
402
}
 
403
 
 
404
int AlbumIconItem::rating() const
 
405
{
 
406
    return d->info.rating();
 
407
}
 
408
 
391
409
}  // namespace Digikam