summaryrefslogtreecommitdiffabout
path: root/microkde/kcolorbutton.cpp
Side-by-side diff
Diffstat (limited to 'microkde/kcolorbutton.cpp') (more/less context) (show whitespace changes)
-rw-r--r--microkde/kcolorbutton.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/microkde/kcolorbutton.cpp b/microkde/kcolorbutton.cpp
index 96dc256..197bea2 100644
--- a/microkde/kcolorbutton.cpp
+++ b/microkde/kcolorbutton.cpp
@@ -7,41 +7,48 @@
#ifdef DESKTOP_VERSION
#include <qcolordialog.h>
#endif
void KColorButton:: edit()
{
#ifdef DESKTOP_VERSION
QColor col = QColorDialog::getColor ( mColor );
if ( col.isValid () ) {
mColor = col;
setColor ( mColor );
emit changed ( mColor );
+ emit changedID ( mColor, id );
}
#else
KColorDialog* k = new KColorDialog( this );
k->setColor( mColor );
int res = k->exec();
if ( res ) {
mColor = k->getColor();
setColor ( mColor );
emit changed ( mColor );
+ emit changedID ( mColor, id );
}
delete k;
#endif
}
KColorButton::KColorButton( QWidget *p ):QPushButton( p )
{
int size = 24;
if( QApplication::desktop()->width() < 480 || QApplication::desktop()->height() <= 320 )
size = 18;
setFixedSize( size,size );
+ int id = 0;
connect ( this, SIGNAL( clicked() ), this ,SLOT (edit() ));
}
+void KColorButton::setID ( int i)
+{
+ id = i;
+}
void KColorButton::setColor ( const QColor & c)
{
mColor = c;
QPixmap pix ( height() - 4, width() - 4 );
pix.fill( c );
setPixmap ( pix );
}