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

« back to all changes in this revision

Viewing changes to digikam/iconitem.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:
63
63
    int            xpos;
64
64
    int            ypos;
65
65
 
66
 
    IconGroupItem *group;
 
66
    IconGroupItem* group;
67
67
};
68
68
 
69
69
IconItem::IconItem(IconGroupItem* parent)
70
 
        : QObject(), d(new IconItemPriv)
 
70
    : QObject(), d(new IconItemPriv)
71
71
{
72
72
    m_next   = 0;
73
73
    m_prev   = 0;
84
84
IconItem* IconItem::nextItem() const
85
85
{
86
86
    if (m_next)
 
87
    {
87
88
        return m_next;
 
89
    }
88
90
 
89
91
    if (d->group->nextGroup())
 
92
    {
90
93
        return d->group->nextGroup()->firstItem();
 
94
    }
91
95
 
92
96
    return 0;
93
97
}
95
99
IconItem* IconItem::prevItem() const
96
100
{
97
101
    if (m_prev)
 
102
    {
98
103
        return m_prev;
 
104
    }
99
105
 
100
106
    if (d->group->prevGroup())
 
107
    {
101
108
        return d->group->prevGroup()->lastItem();
 
109
    }
102
110
 
103
111
    return 0;
104
112
}
154
162
bool IconItem::move(int x, int y)
155
163
{
156
164
    if (d->xpos == x && d->ypos == y)
 
165
    {
157
166
        return false;
 
167
    }
158
168
 
159
 
    d->xpos = x; d->ypos = y;
 
169
    d->xpos = x;
 
170
    d->ypos = y;
160
171
    return true;
161
172
}
162
173
 
164
175
{
165
176
    IconView* view = d->group->iconView();
166
177
 
167
 
    if (cb) 
 
178
    if (cb)
168
179
    {
169
180
        view->blockSignals(true);
170
181
        view->clearSelection();
232
243
    return 0;
233
244
}
234
245
 
235
 
void IconItem::paintItem(QPainter *p)
 
246
void IconItem::paintItem(QPainter* p)
236
247
{
237
248
    IconView* view = d->group->iconView();
238
249
 
256
267
    p->drawPixmap(r.x(), r.y(), pix, 0, 0, r.width(), r.height());
257
268
}
258
269
 
259
 
void IconItem::paintToggleSelectButton(QPainter *p)
 
270
void IconItem::paintToggleSelectButton(QPainter* p)
260
271
{
261
272
    IconView*   view      = d->group->iconView();
262
273
    const int   fadingVal = 128;
282
293
    p->drawEllipse(toggleSelectRect());
283
294
 
284
295
    if (isSelected())
 
296
    {
285
297
        selPix = view->deselectPixmap();
 
298
    }
286
299
    else
 
300
    {
287
301
        selPix = view->selectPixmap();
 
302
    }
288
303
 
289
304
    p->drawPixmap(toggleSelectRect(), iconEffect.apply(selPix, KIconLoader::Desktop, KIconLoader::ActiveState));
290
305
    p->restore();