summaryrefslogtreecommitdiffstats
path: root/src/gui/listboxtext.h
blob: 3cfe2db7036b7f3d3de54dbe2a69343313c4f2f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/***************************************************************************
    copyright            : (C) 2005-2006 by Robby Stephenson
    email                : [email protected]
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of version 2 of the GNU General Public License as  *
 *   published by the Free Software Foundation;                            *
 *                                                                         *
 ***************************************************************************/

#ifndef TELLICO_GUI_LISTBOXTEXT_H
#define TELLICO_GUI_LISTBOXTEXT_H

#include <qlistbox.h>

namespace Tellico {
  namespace GUI {

/**
 * ListBoxText subclasses QListBoxText so that @ref setText() can be made public,
 * and the font color can be changed
 *
 * @author Robby Stephenson
 */
class ListBoxText : public QListBoxText {
public:
  ListBoxText(QListBox* listbox, const QString& text);
  ListBoxText(QListBox* listbox, const QString& text, QListBoxItem* after);

  virtual int width(const QListBox* box) const;
  virtual int height(const QListBox* box) const;

  bool isColored() const { return m_colored; }
  void setColored(bool colored);
  void setText(const QString& text);

protected:
  virtual void paint(QPainter* painter);

private:
  bool m_colored;
};

  } // end namespace
} // end namespace

#endif