summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-07 08:53:18 (UTC)
committer zautrix <zautrix>2005-06-07 08:53:18 (UTC)
commitaa9a9368a7b38e34118b65a4e8efa7ea7ec0e8e4 (patch) (unidiff)
tree69bcfb2ea1e74fa38bf8c648ecba4501dfbe5690
parentff8af7ccdd6346bba1cb871c33931352bbafe40e (diff)
downloadkdepimpi-aa9a9368a7b38e34118b65a4e8efa7ea7ec0e8e4.zip
kdepimpi-aa9a9368a7b38e34118b65a4e8efa7ea7ec0e8e4.tar.gz
kdepimpi-aa9a9368a7b38e34118b65a4e8efa7ea7ec0e8e4.tar.bz2
color dialog fix
Diffstat (more/less context) (ignore 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
@@ -27,6 +27,9 @@
27#endif //KAB_EMBEDDED 27#endif //KAB_EMBEDDED
28 28
29#include "colorlistbox.h" 29#include "colorlistbox.h"
30#ifdef DESKTOP_VERSION
31#include <qcolordialog.h>
32#endif
30 33
31ColorListBox::ColorListBox( QWidget *parent, const char *name, WFlags f ) 34ColorListBox::ColorListBox( QWidget *parent, const char *name, WFlags f )
32 :KListBox( parent, name, f ), mCurrentOnDragEnter(-1) 35 :KListBox( parent, name, f ), mCurrentOnDragEnter(-1)
@@ -97,6 +100,12 @@ void ColorListBox::newColor( int index )
97 setColor( index, c ); 100 setColor( index, c );
98 } 101 }
99#else //KAB_EMBEDDED 102#else //KAB_EMBEDDED
103#ifdef DESKTOP_VERSION
104 QColor col = QColorDialog::getColor ( c );
105 if ( col.isValid () ) {
106 setColor( index, col );
107 }
108#else
100 KColorDialog* k = new KColorDialog( this ); 109 KColorDialog* k = new KColorDialog( this );
101 k->setColor( c ); 110 k->setColor( c );
102 int res = k->exec(); 111 int res = k->exec();
@@ -104,6 +113,7 @@ void ColorListBox::newColor( int index )
104 setColor( index, k->getColor() ); 113 setColor( index, k->getColor() );
105 } 114 }
106 delete k; 115 delete k;
116#endif
107#endif //KAB_EMBEDDED 117#endif //KAB_EMBEDDED
108 118
109 } 119 }
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 @@
4 4
5 5
6#include "qlayout.h" 6#include "qlayout.h"
7 7#ifdef DESKTOP_VERSION
8#include <qcolordialog.h>
9#endif
8void KColorButton:: edit() 10void KColorButton:: edit()
9{ 11{
10 12
13#ifdef DESKTOP_VERSION
14 QColor col = QColorDialog::getColor ( mColor );
15 if ( col.isValid () ) {
16 mColor = col;
17 setColor ( mColor );
18 emit changed ( mColor );
19 }
20#else
11 KColorDialog* k = new KColorDialog( this ); 21 KColorDialog* k = new KColorDialog( this );
12 k->setColor( mColor ); 22 k->setColor( mColor );
13 int res = k->exec(); 23 int res = k->exec();
@@ -17,6 +27,7 @@ void KColorButton:: edit()
17 emit changed ( mColor ); 27 emit changed ( mColor );
18 } 28 }
19 delete k; 29 delete k;
30#endif
20} 31}
21KColorButton::KColorButton( QWidget *p ):QPushButton( p ) 32KColorButton::KColorButton( QWidget *p ):QPushButton( p )
22{ 33{