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