summaryrefslogtreecommitdiff
path: root/libopie
authordrw <drw>2002-12-05 17:13:45 (UTC)
committer drw <drw>2002-12-05 17:13:45 (UTC)
commit675ab68194cc25793a18fd9e495958a90aaf0173 (patch) (unidiff)
treee2599a7dbef3184f015593f0b7ffe533c45a5ba5 /libopie
parent1eb333726ccf7c608b9f987aac1a04d37d35936c (diff)
downloadopie-675ab68194cc25793a18fd9e495958a90aaf0173.zip
opie-675ab68194cc25793a18fd9e495958a90aaf0173.tar.gz
opie-675ab68194cc25793a18fd9e495958a90aaf0173.tar.bz2
Modified OColorButton to pass color to color dialog. Impacts appearance, launcher settings and liquid settings.
Diffstat (limited to 'libopie') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ocolorbutton.cpp20
-rw-r--r--libopie/ocolorbutton.h14
2 files changed, 17 insertions, 17 deletions
diff --git a/libopie/ocolorbutton.cpp b/libopie/ocolorbutton.cpp
index 4734c0c..ddb6c4f 100644
--- a/libopie/ocolorbutton.cpp
+++ b/libopie/ocolorbutton.cpp
@@ -22,48 +22,48 @@
22    --        :-=` this library; see the file COPYING.LIB. 22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation, 23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330, 24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include <opie/colorpopupmenu.h> 29#include <opie/colorpopupmenu.h>
30#include <opie/ocolorbutton.h> 30#include <opie/ocolorbutton.h>
31#include <qcolor.h> 31#include <qcolor.h>
32#include <qpixmap.h> 32#include <qpixmap.h>
33#include <qimage.h> 33#include <qimage.h>
34 34
35 #include <qpe/resource.h> 35#include <qpe/resource.h>
36 36
37class OColorButtonPrivate { 37class OColorButtonPrivate {
38public: 38public:
39 QPopupMenu *m_menu; 39 QPopupMenu *m_menu;
40 QColor m_color; 40 QColor m_color;
41}; 41};
42 42
43OColorButton::OColorButton ( QWidget *parent, const char *name ) 43OColorButton::OColorButton ( QWidget *parent, const QColor &color, const char *name )
44 : QPushButton ( parent, name ) 44 : QPushButton ( parent, name )
45{ 45{
46 d = new OColorButtonPrivate; 46 d = new OColorButtonPrivate;
47 47
48 d-> m_menu = new ColorPopupMenu ( black, 0, 0 ); 48 d-> m_menu = new ColorPopupMenu ( color, 0, 0 );
49 setPopup ( d-> m_menu ); 49 setPopup ( d-> m_menu );
50 //setPopupDelay ( 0 ); 50 //setPopupDelay ( 0 );
51 connect ( d-> m_menu, SIGNAL( colorSelected ( const QColor & )), this, SLOT( updateColor ( const QColor & ))); 51 connect ( d-> m_menu, SIGNAL( colorSelected ( const QColor & )), this, SLOT( updateColor ( const QColor & )));
52 52
53 updateColor ( black ); 53 updateColor ( color );
54 54
55 QSize s = sizeHint ( ) + QSize ( 12, 0 ); 55 QSize s = sizeHint ( ) + QSize ( 12, 0 );
56 setMinimumSize ( s ); 56 setMinimumSize ( s );
57 setMaximumSize ( s. width ( ) * 2, s. height ( )); 57 setMaximumSize ( s. width ( ) * 2, s. height ( ));
58} 58}
59 59
60OColorButton::~OColorButton ( ) 60OColorButton::~OColorButton ( )
61{ 61{
62 delete d; 62 delete d;
63} 63}
64 64
65QColor OColorButton::color ( ) const 65QColor OColorButton::color ( ) const
66{ 66{
67 return d-> m_color; 67 return d-> m_color;
68} 68}
69 69
diff --git a/libopie/ocolorbutton.h b/libopie/ocolorbutton.h
index ec04833..fe40fae 100644
--- a/libopie/ocolorbutton.h
+++ b/libopie/ocolorbutton.h
@@ -18,42 +18,42 @@
18++=   -.     .`     .: details. 18++=   -.     .`     .: details.
19 :     =  ...= . :.=- 19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU 20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = Library General Public License along with 21  -_. . .   )=.  = Library General Public License along with
22    --        :-=` this library; see the file COPYING.LIB. 22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation, 23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330, 24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#ifndef __OPIE_OCOLORBUTTON_H__ 29#ifndef __OPIE_OCOLORBUTTON_H__
30 #define __OPIE_OCOLORBUTTON_H__ 30#define __OPIE_OCOLORBUTTON_H__
31 31
32#include <qpushbutton.h> 32#include <qpushbutton.h>
33 33
34class OColorButtonPrivate; 34class OColorButtonPrivate;
35class QColor; 35class QColor;
36 36
37class OColorButton : public QPushButton { 37class OColorButton : public QPushButton {
38 Q_OBJECT 38 Q_OBJECT
39public: 39public:
40 OColorButton ( QWidget *parent = 0, const char *name = 0 ); 40 OColorButton ( QWidget *parent = 0, const QColor & = black, const char *name = 0 );
41 virtual ~OColorButton ( ); 41 virtual ~OColorButton ( );
42 42
43 QColor color ( ) const; 43 QColor color ( ) const;
44 44
45signals: 45signals:
46 void colorSelected ( const QColor & ); 46 void colorSelected ( const QColor & );
47 47
48public slots: 48public slots:
49 virtual void setColor ( const QColor & ); 49 virtual void setColor ( const QColor & );
50 50
51 protected slots: 51 protected slots:
52 virtual void updateColor ( const QColor & ); 52 virtual void updateColor ( const QColor & );
53 53
54private: 54private:
55 OColorButtonPrivate *d; 55 OColorButtonPrivate *d;
56 }; 56 };
57 57
58#endif 58#endif
59 59