]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/qcoloritem.h
Joao latest bits
[lyx.git] / src / frontends / qt2 / qcoloritem.h
1 // -*- C++ -*-
2 /**
3  * \file qcoloritem.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <qlistbox.h>
13 #include <qcolor.h>
14
15 class QColorItem : public QListBoxItem {
16
17 public:
18         QColorItem(QColor c, QString const & text);
19
20         QColor color() {
21                 return color_;
22         }
23
24         void color(QColor c) {
25                 color_ = c;
26         }
27
28         virtual int height(const QListBox *) const {
29                 return height_;
30         }
31
32         virtual int width(const QListBox *) const {
33                 return width_;
34         }
35
36 protected:
37         virtual void paint(QPainter * p);
38
39 private:
40         int ascent_;
41
42         int height_;
43
44         int width_;
45
46         QColor color_;
47
48         QString text_;
49 };