summaryrefslogtreecommitdiff
path: root/libopie/ocolorbutton.cpp
Unidiff
Diffstat (limited to 'libopie/ocolorbutton.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie/ocolorbutton.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/libopie/ocolorbutton.cpp b/libopie/ocolorbutton.cpp
index ddb6c4f..113a77a 100644
--- a/libopie/ocolorbutton.cpp
+++ b/libopie/ocolorbutton.cpp
@@ -34,18 +34,26 @@
34 34
35#include <qpe/resource.h> 35#include <qpe/resource.h>
36 36
37class OColorButtonPrivate { 37struct OColorButtonPrivate {
38public:
39 QPopupMenu *m_menu; 38 QPopupMenu *m_menu;
40 QColor m_color; 39 QColor m_color;
41}; 40};
42 41
42
43/**
44 * This concstructs a Color Button with @param color as the start color
45 * It'll use a OColorPopupMenu internally
46 *
47 * @param parent The parent of the Color Button
48 * @param color The color from where to start on
49 * @param name @see QObject
50 */
43OColorButton::OColorButton ( QWidget *parent, const QColor &color, const char *name ) 51OColorButton::OColorButton ( QWidget *parent, const QColor &color, const char *name )
44 : QPushButton ( parent, name ) 52 : QPushButton ( parent, name )
45{ 53{
46 d = new OColorButtonPrivate; 54 d = new OColorButtonPrivate;
47 55
48 d-> m_menu = new ColorPopupMenu ( color, 0, 0 ); 56 d-> m_menu = new OColorPopupMenu ( color, 0, 0 );
49 setPopup ( d-> m_menu ); 57 setPopup ( d-> m_menu );
50 //setPopupDelay ( 0 ); 58 //setPopupDelay ( 0 );
51 connect ( d-> m_menu, SIGNAL( colorSelected ( const QColor & )), this, SLOT( updateColor ( const QColor & ))); 59 connect ( d-> m_menu, SIGNAL( colorSelected ( const QColor & )), this, SLOT( updateColor ( const QColor & )));
@@ -57,21 +65,34 @@ OColorButton::OColorButton ( QWidget *parent, const QColor &color, const char *n
57 setMaximumSize ( s. width ( ) * 2, s. height ( )); 65 setMaximumSize ( s. width ( ) * 2, s. height ( ));
58} 66}
59 67
68/**
69 * This destructs the object
70 */
60OColorButton::~OColorButton ( ) 71OColorButton::~OColorButton ( )
61{ 72{
62 delete d; 73 delete d;
63} 74}
64 75
76/**
77 * @return Returns the current color of the button
78 */
65QColor OColorButton::color ( ) const 79QColor OColorButton::color ( ) const
66{ 80{
67 return d-> m_color; 81 return d-> m_color;
68} 82}
69 83
84/**
85 * This method sets the color of the button
86 * @param c The color to be set.
87 */
70void OColorButton::setColor ( const QColor &c ) 88void OColorButton::setColor ( const QColor &c )
71{ 89{
72 updateColor ( c ); 90 updateColor ( c );
73} 91}
74 92
93/**
94 * @internal
95 */
75void OColorButton::updateColor ( const QColor &c ) 96void OColorButton::updateColor ( const QColor &c )
76{ 97{
77 d-> m_color = c; 98 d-> m_color = c;