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) (side-by-side diff)
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
@@ -10,72 +10,72 @@
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This library is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.=       =       ; Library General Public License for more
++=   -.     .`     .: details.
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include <opie/colorpopupmenu.h>
#include <opie/ocolorbutton.h>
#include <qcolor.h>
#include <qpixmap.h>
#include <qimage.h>
-
-#include <qpe/resource.h>
-
+
+#include <qpe/resource.h>
+
class OColorButtonPrivate {
public:
QPopupMenu *m_menu;
QColor m_color;
};
-OColorButton::OColorButton ( QWidget *parent, const char *name )
+OColorButton::OColorButton ( QWidget *parent, const QColor &color, const char *name )
: QPushButton ( parent, name )
{
d = new OColorButtonPrivate;
-
- d-> m_menu = new ColorPopupMenu ( black, 0, 0 );
+
+ d-> m_menu = new ColorPopupMenu ( color, 0, 0 );
setPopup ( d-> m_menu );
// setPopupDelay ( 0 );
connect ( d-> m_menu, SIGNAL( colorSelected ( const QColor & )), this, SLOT( updateColor ( const QColor & )));
-
- updateColor ( black );
-
+
+ updateColor ( color );
+
QSize s = sizeHint ( ) + QSize ( 12, 0 );
setMinimumSize ( s );
- setMaximumSize ( s. width ( ) * 2, s. height ( ));
+ setMaximumSize ( s. width ( ) * 2, s. height ( ));
}
OColorButton::~OColorButton ( )
{
delete d;
}
QColor OColorButton::color ( ) const
{
return d-> m_color;
}
void OColorButton::setColor ( const QColor &c )
{
updateColor ( c );
}
void OColorButton::updateColor ( const QColor &c )
{
d-> m_color = c;
QImage img ( 16, 16, 32 );
img. fill ( 0 );
diff --git a/libopie/ocolorbutton.h b/libopie/ocolorbutton.h
index ec04833..fe40fae 100644
--- a/libopie/ocolorbutton.h
+++ b/libopie/ocolorbutton.h
@@ -6,54 +6,54 @@
.> <`_,   >  .   <= redistribute it and/or modify it under
:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
.="- .-=="i,     .._ License as published by the Free Software
 - .   .-<_>     .<> Foundation; either version 2 of the License,
     ._= =}       : or (at your option) any later version.
    .%`+i>       _;_.
    .i_,=:_.      -<s. This library is distributed in the hope that
     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
    : ..    .:,     . . . without even the implied warranty of
    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
..}^=.=       =       ; Library General Public License for more
++=   -.     .`     .: details.
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#ifndef __OPIE_OCOLORBUTTON_H__
-#define __OPIE_OCOLORBUTTON_H__
-
+#define __OPIE_OCOLORBUTTON_H__
+
#include <qpushbutton.h>
class OColorButtonPrivate;
class QColor;
class OColorButton : public QPushButton {
Q_OBJECT
public:
- OColorButton ( QWidget *parent = 0, const char *name = 0 );
+ OColorButton ( QWidget *parent = 0, const QColor & = black, const char *name = 0 );
virtual ~OColorButton ( );
-
+
QColor color ( ) const;
-
+
signals:
- void colorSelected ( const QColor & );
-
+ void colorSelected ( const QColor & );
+
public slots:
virtual void setColor ( const QColor & );
protected slots:
virtual void updateColor ( const QColor & );
private:
OColorButtonPrivate *d;
};
#endif