From aa9a9368a7b38e34118b65a4e8efa7ea7ec0e8e4 Mon Sep 17 00:00:00 2001 From: zautrix Date: Tue, 07 Jun 2005 08:53:18 +0000 Subject: color dialog fix --- diff --git a/kaddressbook/views/colorlistbox.cpp b/kaddressbook/views/colorlistbox.cpp index 7386207..2bddca6 100644 --- a/kaddressbook/views/colorlistbox.cpp +++ b/kaddressbook/views/colorlistbox.cpp @@ -27,6 +27,9 @@ #endif //KAB_EMBEDDED #include "colorlistbox.h" +#ifdef DESKTOP_VERSION +#include +#endif ColorListBox::ColorListBox( QWidget *parent, const char *name, WFlags f ) :KListBox( parent, name, f ), mCurrentOnDragEnter(-1) @@ -97,6 +100,12 @@ void ColorListBox::newColor( int index ) setColor( index, c ); } #else //KAB_EMBEDDED +#ifdef DESKTOP_VERSION + QColor col = QColorDialog::getColor ( c ); + if ( col.isValid () ) { + setColor( index, col ); + } +#else KColorDialog* k = new KColorDialog( this ); k->setColor( c ); int res = k->exec(); @@ -104,6 +113,7 @@ void ColorListBox::newColor( int index ) setColor( index, k->getColor() ); } delete k; +#endif #endif //KAB_EMBEDDED } diff --git a/microkde/kcolorbutton.cpp b/microkde/kcolorbutton.cpp index 433f909..c7c6088 100644 --- a/microkde/kcolorbutton.cpp +++ b/microkde/kcolorbutton.cpp @@ -4,10 +4,20 @@ #include "qlayout.h" - +#ifdef DESKTOP_VERSION +#include +#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(); @@ -17,6 +27,7 @@ void KColorButton:: edit() emit changed ( mColor ); } delete k; +#endif } KColorButton::KColorButton( QWidget *p ):QPushButton( p ) { -- cgit v0.9.0.2