~ubuntu-branches/ubuntu/quantal/muse/quantal

« back to all changes in this revision

Viewing changes to muse/widgets/ttoolbutton.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2011-08-12 11:16:41 UTC
  • mto: (1.1.9) (10.1.6 sid)
  • mto: This revision was merged to the branch mainline in revision 26.
  • Revision ID: james.westby@ubuntu.com-20110812111641-72iatqb9jomjejko
ImportĀ upstreamĀ versionĀ 2.0~beta2

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
//  (C) Copyright 2004 Werner Schweer (ws@seh.de)
6
6
//=========================================================
7
7
 
8
 
#include <qpainter.h>
 
8
#include <QPainter>
 
9
#include <QStyle>
9
10
 
10
11
#include "ttoolbutton.h"
11
12
#include "gconfig.h"
19
20
      {
20
21
      int w = width();
21
22
      int h = height();
22
 
      QIconSet::Mode mode = isEnabled() ? QIconSet::Normal : QIconSet::Disabled;
23
 
      QIconSet::State state = isOn() ? QIconSet::On : QIconSet::Off;
24
 
      const QPixmap pm(iconSet().pixmap(QIconSet::Automatic, mode, state));
 
23
      QIcon::Mode mode = isEnabled() ? QIcon::Normal : QIcon::Disabled;
 
24
      QIcon::State state = isChecked() ? QIcon::On : QIcon::Off;
 
25
      const QPixmap pm(icon().pixmap(style()->pixelMetric(QStyle::PM_SmallIconSize), mode, state));
25
26
      p->drawPixmap(QPoint((w - pm.width())/2, (h - pm.height())/2), pm);
26
27
      }
27
28