~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to themedesigner/themediconitem.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-12-21 23:19:11 UTC
  • mfrom: (1.2.33 upstream) (3.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20101221231911-z9jip7s5aht1jqn9
Tags: 2:1.7.0-1ubuntu1
* Merge from Debian Experimental. Remaining Ubuntu changes:
  - Export .pot name and copy to plugins in debian/rules
  - Version build-depends on kipi-plugins-dev to ensure build is against the
    same version on all archs
* Drop debian/patches/kubuntu_01_linker.diff, incoporated upstream
* Remove patches directory and unused patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
51
51
{
52
52
 
53
53
ThemedIconItem::ThemedIconItem(IconGroupItem* parent)
54
 
              : IconItem(parent)
 
54
    : IconItem(parent)
55
55
{
56
56
}
57
57
 
62
62
void ThemedIconItem::paintItem(QPainter* p2)
63
63
{
64
64
    ThemedIconView* view = qobject_cast<ThemedIconView*>(iconView());
 
65
 
65
66
    if (!view)
 
67
    {
66
68
        return;
 
69
    }
67
70
 
68
71
    QPixmap pix;
69
72
    QRect   r;
70
73
 
71
74
    if (isSelected())
 
75
    {
72
76
        pix = *(view->itemBaseSelPixmap());
 
77
    }
73
78
    else
 
79
    {
74
80
        pix = *(view->itemBaseRegPixmap());
 
81
    }
75
82
 
76
83
    ThemeEngine* te = ThemeEngine::instance();
77
84
 
80
87
 
81
88
    {
82
89
        r                       = view->itemPixmapRect();
83
 
        KIconLoader *iconLoader = KIconLoader::global();
 
90
        KIconLoader* iconLoader = KIconLoader::global();
84
91
        QPixmap thumbnail       = iconLoader->loadIcon("image-jpeg", KIconLoader::NoGroup, 128);
85
92
 
86
93
        p.drawPixmap(r.x() + (r.width()-thumbnail.width())/2,
125
132
    p.end();
126
133
 
127
134
    r = view->itemRect();
128
 
//    r = QRect(view->contentsToViewport(QPoint(r.x(), r.y())),
129
 
//              QSize(r.width(), r.height()));
 
135
    //    r = QRect(view->contentsToViewport(QPoint(r.x(), r.y())),
 
136
    //              QSize(r.width(), r.height()));
130
137
 
131
138
    p2->drawPixmap(r.x(), r.y(), pix, 0, 0, r.width(), r.height());
132
139
}