-rw-r--r-- | microkde/kcolorbutton.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/microkde/kcolorbutton.cpp b/microkde/kcolorbutton.cpp index 433f909..c7c6088 100644 --- a/microkde/kcolorbutton.cpp +++ b/microkde/kcolorbutton.cpp @@ -1,25 +1,36 @@ #include "kcolorbutton.h" #include "kcolordialog.h" #include "qapplication.h" #include "qlayout.h" - +#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 ); + } +#else KColorDialog* k = new KColorDialog( this ); k->setColor( mColor ); int res = k->exec(); if ( res ) { mColor = k->getColor(); setColor ( mColor ); emit changed ( mColor ); } delete k; +#endif } KColorButton::KColorButton( QWidget *p ):QPushButton( p ) { int size = 24; if( QApplication::desktop()->width() < 480 ) size = 18; |