-rw-r--r-- | microkde/kcolorbutton.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/microkde/kcolorbutton.cpp b/microkde/kcolorbutton.cpp index 197bea2..16618fc 100644 --- a/microkde/kcolorbutton.cpp +++ b/microkde/kcolorbutton.cpp | |||
@@ -1,40 +1,43 @@ | |||
1 | #include "kcolorbutton.h" | 1 | #include "kcolorbutton.h" |
2 | #include "kcolordialog.h" | 2 | #include "kcolordialog.h" |
3 | #include "qapplication.h" | 3 | #include "qapplication.h" |
4 | #include <QDesktopWidget> | ||
4 | 5 | ||
5 | 6 | ||
6 | #include "qlayout.h" | 7 | #include "qlayout.h" |
7 | #ifdef DESKTOP_VERSION | 8 | #ifdef DESKTOP_VERSION |
8 | #include <qcolordialog.h> | 9 | #include <qcolordialog.h> |
10 | //Added by qt3to4: | ||
11 | #include <QPixmap> | ||
9 | #endif | 12 | #endif |
10 | void KColorButton:: edit() | 13 | void KColorButton:: edit() |
11 | { | 14 | { |
12 | 15 | ||
13 | #ifdef DESKTOP_VERSION | 16 | #ifdef DESKTOP_VERSION |
14 | QColor col = QColorDialog::getColor ( mColor ); | 17 | QColor col = QColorDialog::getColor ( mColor ); |
15 | if ( col.isValid () ) { | 18 | if ( col.isValid () ) { |
16 | mColor = col; | 19 | mColor = col; |
17 | setColor ( mColor ); | 20 | setColor ( mColor ); |
18 | emit changed ( mColor ); | 21 | emit changed ( mColor ); |
19 | emit changedID ( mColor, id ); | 22 | emit changedID ( mColor, id ); |
20 | } | 23 | } |
21 | #else | 24 | #else |
22 | KColorDialog* k = new KColorDialog( this ); | 25 | KColorDialog* k = new KColorDialog( this ); |
23 | k->setColor( mColor ); | 26 | k->setColor( mColor ); |
24 | int res = k->exec(); | 27 | int res = k->exec(); |
25 | if ( res ) { | 28 | if ( res ) { |
26 | mColor = k->getColor(); | 29 | mColor = k->getColor(); |
27 | setColor ( mColor ); | 30 | setColor ( mColor ); |
28 | emit changed ( mColor ); | 31 | emit changed ( mColor ); |
29 | emit changedID ( mColor, id ); | 32 | emit changedID ( mColor, id ); |
30 | } | 33 | } |
31 | delete k; | 34 | delete k; |
32 | #endif | 35 | #endif |
33 | } | 36 | } |
34 | KColorButton::KColorButton( QWidget *p ):QPushButton( p ) | 37 | KColorButton::KColorButton( QWidget *p ):QPushButton( p ) |
35 | { | 38 | { |
36 | int size = 24; | 39 | int size = 24; |
37 | if( QApplication::desktop()->width() < 480 || QApplication::desktop()->height() <= 320 ) | 40 | if( QApplication::desktop()->width() < 480 || QApplication::desktop()->height() <= 320 ) |
38 | size = 18; | 41 | size = 18; |
39 | setFixedSize( size,size ); | 42 | setFixedSize( size,size ); |
40 | int id = 0; | 43 | int id = 0; |