-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 | |||
@@ -3,12 +3,22 @@ | |||
3 | #include "qapplication.h" | 3 | #include "qapplication.h" |
4 | 4 | ||
5 | 5 | ||
6 | #include "qlayout.h" | 6 | #include "qlayout.h" |
7 | 7 | #ifdef DESKTOP_VERSION | |
8 | #include <qcolordialog.h> | ||
9 | #endif | ||
8 | void KColorButton:: edit() | 10 | void 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(); |
14 | if ( res ) { | 24 | if ( res ) { |
@@ -16,8 +26,9 @@ void KColorButton:: edit() | |||
16 | setColor ( mColor ); | 26 | setColor ( mColor ); |
17 | emit changed ( mColor ); | 27 | emit changed ( mColor ); |
18 | } | 28 | } |
19 | delete k; | 29 | delete k; |
30 | #endif | ||
20 | } | 31 | } |
21 | KColorButton::KColorButton( QWidget *p ):QPushButton( p ) | 32 | KColorButton::KColorButton( QWidget *p ):QPushButton( p ) |
22 | { | 33 | { |
23 | int size = 24; | 34 | int size = 24; |