summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--kaddressbook/views/colorlistbox.cpp10
-rw-r--r--microkde/kcolorbutton.cpp13
2 files changed, 22 insertions, 1 deletions
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
@@ -26,8 +26,11 @@
#include <kcolordrag.h>
#endif //KAB_EMBEDDED
#include "colorlistbox.h"
+#ifdef DESKTOP_VERSION
+#include <qcolordialog.h>
+#endif
ColorListBox::ColorListBox( QWidget *parent, const char *name, WFlags f )
:KListBox( parent, name, f ), mCurrentOnDragEnter(-1)
{
@@ -96,15 +99,22 @@ 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();
if ( res ) {
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
@@ -3,12 +3,22 @@
#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 ) {
@@ -16,8 +26,9 @@ void KColorButton:: edit()
setColor ( mColor );
emit changed ( mColor );
}
delete k;
+#endif
}
KColorButton::KColorButton( QWidget *p ):QPushButton( p )
{
int size = 24;