-rw-r--r-- | libopie/colorpopupmenu.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libopie/colorpopupmenu.h b/libopie/colorpopupmenu.h index 1206ac3..1a6ab08 100644 --- a/libopie/colorpopupmenu.h +++ b/libopie/colorpopupmenu.h | |||
@@ -1,77 +1,81 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** ColorPopupMenu | 2 | ** ColorPopupMenu |
3 | ** | 3 | ** |
4 | ** Popup menu for selecting colors | 4 | ** Popup menu for selecting colors |
5 | ** | 5 | ** |
6 | ** Based on colorpanel by S. Prud'homme <prudhomme@laposte.net> | 6 | ** Based on colorpanel by S. Prud'homme <prudhomme@laposte.net> |
7 | ** | 7 | ** |
8 | ** Copyright (C) 2002, Dan Williams | 8 | ** Copyright (C) 2002, Dan Williams |
9 | ** williamsdr@acm.org | 9 | ** williamsdr@acm.org |
10 | ** http://draknor.net | 10 | ** http://draknor.net |
11 | ** | 11 | ** |
12 | ** This file may be distributed and/or modified under the terms of the | 12 | ** This file may be distributed and/or modified under the terms of the |
13 | ** GNU General Public License version 2 as published by the Free Software | 13 | ** GNU General Public License version 2 as published by the Free Software |
14 | ** Foundation and appearing in the file LICENSE.GPL included in the | 14 | ** Foundation and appearing in the file LICENSE.GPL included in the |
15 | ** packaging of this file. | 15 | ** packaging of this file. |
16 | ** | 16 | ** |
17 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 17 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
18 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 18 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
19 | ** | 19 | ** |
20 | **********************************************************************/ | 20 | **********************************************************************/ |
21 | 21 | ||
22 | #ifndef COLORPOPUPMENU_H | 22 | #ifndef COLORPOPUPMENU_H |
23 | #define COLORPOPUPMENU_H | 23 | #define COLORPOPUPMENU_H |
24 | 24 | ||
25 | #include <qframe.h> | 25 | #include <qframe.h> |
26 | #include <qpopupmenu.h> | 26 | #include <qpopupmenu.h> |
27 | 27 | ||
28 | class QWidget; | 28 | class QWidget; |
29 | class QGridLayout; | 29 | class QGridLayout; |
30 | 30 | ||
31 | class ColorPanelButton : public QFrame | 31 | class ColorPanelButton : public QFrame |
32 | { | 32 | { |
33 | Q_OBJECT | 33 | Q_OBJECT |
34 | 34 | ||
35 | public: | 35 | public: |
36 | ColorPanelButton(const QColor& color, QWidget* parent = 0, const char* name = 0); | 36 | ColorPanelButton(const QColor& color, QWidget* parent = 0, const char* name = 0); |
37 | ~ColorPanelButton(); | 37 | ~ColorPanelButton(); |
38 | 38 | ||
39 | void setActive(bool active); | 39 | void setActive(bool active); |
40 | 40 | ||
41 | void enterEvent(QEvent* e); | 41 | void enterEvent(QEvent* e); |
42 | void leaveEvent(QEvent* e); | 42 | void leaveEvent(QEvent* e); |
43 | void paintEvent(QPaintEvent* e); | 43 | void paintEvent(QPaintEvent* e); |
44 | void mouseReleaseEvent(QMouseEvent* e); | 44 | void mouseReleaseEvent(QMouseEvent* e); |
45 | 45 | ||
46 | signals: | 46 | signals: |
47 | void selected(const QColor&); | 47 | void selected(const QColor&); |
48 | 48 | ||
49 | private: | 49 | private: |
50 | QColor m_color; | 50 | QColor m_color; |
51 | bool m_active; | 51 | bool m_active : 1; |
52 | class ColorPanelButtonPrivate; | ||
53 | ColorPanelButtonPrivate *d; | ||
52 | }; | 54 | }; |
53 | 55 | ||
54 | class ColorPopupMenu : public QPopupMenu | 56 | class ColorPopupMenu : public QPopupMenu |
55 | { | 57 | { |
56 | Q_OBJECT | 58 | Q_OBJECT |
57 | 59 | ||
58 | public: | 60 | public: |
59 | ColorPopupMenu( const QColor& color, QWidget* parent = 0, const char* name = 0 ); | 61 | ColorPopupMenu( const QColor& color, QWidget* parent = 0, const char* name = 0 ); |
60 | ~ColorPopupMenu(); | 62 | ~ColorPopupMenu(); |
61 | 63 | ||
62 | private: | 64 | private: |
65 | class ColorPopupMenuPrivate; | ||
66 | ColorPopupMenuPrivate *d; | ||
63 | QColor m_color; | 67 | QColor m_color; |
64 | QWidget* colorPanel; | 68 | QWidget* colorPanel; |
65 | QGridLayout* colorLayout; | 69 | QGridLayout* colorLayout; |
66 | 70 | ||
67 | void addColor( const QColor& color, int row, int col ); | 71 | void addColor( const QColor& color, int row, int col ); |
68 | 72 | ||
69 | signals: | 73 | signals: |
70 | void colorSelected( const QColor& color ); | 74 | void colorSelected( const QColor& color ); |
71 | 75 | ||
72 | protected slots: | 76 | protected slots: |
73 | void buttonSelected( const QColor& color ); | 77 | void buttonSelected( const QColor& color ); |
74 | void moreColorClicked(); | 78 | void moreColorClicked(); |
75 | }; | 79 | }; |
76 | 80 | ||
77 | #endif // COLORPOPUPMENUANEL_H | 81 | #endif // COLORPOPUPMENUANEL_H |