~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to noatun/noatun/modules/liszt/CharlatanItem.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2000 Rik Hemsley (rikkus) <rik@kde.org>. All rights reserved.
 
3
 *
 
4
LICENSE
 
5
 */
 
6
 
 
7
#include <qbrush.h>
 
8
#include "CharlatanItem.h"
 
9
#include "Static.h"
 
10
 
 
11
  void
 
12
CharlatanItem::paintCell(
 
13
    QPainter * p,
 
14
    const QColorGroup & g,
 
15
    int c,
 
16
    int w,
 
17
    int a
 
18
)
 
19
{
 
20
  if (c < 2)
 
21
    return QListViewItem::paintCell(p, g, c, w, a);
 
22
 
 
23
  p->fillRect(0, 0, 16, height(), Qt::white);
 
24
  QBrush b(g.button());
 
25
 
 
26
  int top = height() / 2 - 8;
 
27
  qDrawShadeRect(p, 0, top, 16, 16, g, sunken_ == c, 1, 1, &b);
 
28
 
 
29
  int ofs = sunken_ == c ? 3 : 2;
 
30
 
 
31
  switch (c) {
 
32
 
 
33
    case 2:
 
34
      p->drawPixmap(ofs, top + ofs, Static::instance()->pixmap("plus"));
 
35
      break;
 
36
 
 
37
    case 3:
 
38
      p->drawPixmap(ofs, top + ofs, Static::instance()->pixmap("minus"));
 
39
      break;
 
40
 
 
41
    default:
 
42
      break;
 
43
  }
 
44
}
 
45