author | zautrix <zautrix> | 2005-06-12 22:36:41 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-12 22:36:41 (UTC) |
commit | 5e4f16e92a96bdf89f82be3b231d18ae9e257486 (patch) (side-by-side diff) | |
tree | 6bf55a0ae92e95dc598a813ed7b7eef5c00dfb4f /microkde | |
parent | 8cfca2b9b7ece646229a72843cf8d6d63e7b8af9 (diff) | |
download | kdepimpi-5e4f16e92a96bdf89f82be3b231d18ae9e257486.zip kdepimpi-5e4f16e92a96bdf89f82be3b231d18ae9e257486.tar.gz kdepimpi-5e4f16e92a96bdf89f82be3b231d18ae9e257486.tar.bz2 |
fixxxx
-rw-r--r-- | microkde/kcolorbutton.cpp | 7 | ||||
-rw-r--r-- | microkde/kcolorbutton.h | 3 |
2 files changed, 10 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 @@ -11,37 +11,44 @@ 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 ); } diff --git a/microkde/kcolorbutton.h b/microkde/kcolorbutton.h index 88b3774..983771b 100644 --- a/microkde/kcolorbutton.h +++ b/microkde/kcolorbutton.h @@ -9,18 +9,21 @@ class KColorButton : public QPushButton { Q_OBJECT public: KColorButton( QWidget *p ); void setColor ( const QColor &); + void setID ( int i) ; QColor color() const { return mColor ; } signals: void changed(const QColor &); + void changedID(const QColor &, int id); private slots: void edit(); private: QColor mColor; + int id; }; #endif |