]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/iconpalette.h
fix rbearing
[lyx.git] / src / frontends / qt2 / iconpalette.h
1 /**
2  * \file iconpalette.h
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon
7  */
8
9 #ifndef ICONPALETTE_H
10 #define ICONPALETTE_H
11
12 #include <config.h>
13
14 #include "LString.h"
15  
16 #include <qwidget.h>
17
18 #include <vector>
19 #include <algorithm>
20
21 class QPixmap;
22 class QPushButton;
23 class QGridLayout;
24
25 /**
26  * For holding an arbitrary set of icons.
27  */
28 class IconPalette : public QWidget {
29         Q_OBJECT
30 public:
31         IconPalette(QWidget * parent, char const * name = 0);
32
33         /// add a button
34         void add(QPixmap const & pixmap, string name, string tooltip);
35
36 signals:
37         void button_clicked(string);
38
39 protected:
40         virtual void resizeEvent(QResizeEvent * e);
41  
42 protected slots:
43         virtual void clicked();
44
45 private:
46         int maxcol_;
47  
48         QGridLayout * layout_;
49  
50         typedef std::pair<QPushButton *, string> Button;
51  
52         std::vector<Button> buttons_;
53 };
54
55 #endif // ICONPALETTE_H