Diffstat (limited to 'kaddressbook/details/look_details.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | kaddressbook/details/look_details.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kaddressbook/details/look_details.cpp b/kaddressbook/details/look_details.cpp index 51ec0c0..11d06e9 100644 --- a/kaddressbook/details/look_details.cpp +++ b/kaddressbook/details/look_details.cpp | |||
@@ -18,97 +18,97 @@ | |||
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <kconfig.h> | 24 | #include <kconfig.h> |
25 | #include <kdebug.h> | 25 | #include <kdebug.h> |
26 | #include <kglobalsettings.h> | 26 | #include <kglobalsettings.h> |
27 | #include <kinstance.h> | 27 | #include <kinstance.h> |
28 | #include <klocale.h> | 28 | #include <klocale.h> |
29 | #include <kstandarddirs.h> | 29 | #include <kstandarddirs.h> |
30 | 30 | ||
31 | #include <qcursor.h> | 31 | #include <qcursor.h> |
32 | #include <qdir.h> | 32 | #include <qdir.h> |
33 | #include <qpainter.h> | 33 | #include <qpainter.h> |
34 | #include <qpopupmenu.h> | 34 | #include <qpopupmenu.h> |
35 | 35 | ||
36 | #include "global.h" | 36 | #include "global.h" |
37 | #include "kabentrypainter.h" | 37 | #include "kabentrypainter.h" |
38 | 38 | ||
39 | #include "look_details.h" | 39 | #include "look_details.h" |
40 | 40 | ||
41 | #define GRID 5 | 41 | #define GRID 5 |
42 | 42 | ||
43 | const QString KABDetailedView::mBorderedBGDir = "kab3part/backgrounds/bordered/"; | 43 | const QString KABDetailedView::mBorderedBGDir = "kab3part/backgrounds/bordered/"; |
44 | const QString KABDetailedView::mTiledBGDir = "kab3part/backgrounds/tiled/"; | 44 | const QString KABDetailedView::mTiledBGDir = "kab3part/backgrounds/tiled/"; |
45 | 45 | ||
46 | KABDetailedView::KABDetailedView( QWidget *parent, const char *name ) | 46 | KABDetailedView::KABDetailedView( QWidget *parent, const char *name ) |
47 | : KABBasicLook( parent, name ), mPainter( 0 ), mBackgroundStyle( None ), | 47 | : KABBasicLook( parent, name ), mPainter( 0 ), mBackgroundStyle( None ), |
48 | mDefaultBGColor( white ), mHeadLineBGColor( darkBlue ), | 48 | mDefaultBGColor( white ), mHeadLineBGColor( darkBlue ), |
49 | mHeadLineTextColor( yellow ), mGrid( 3 ), mMenuBorderedBG( 0 ), | 49 | mHeadLineTextColor( yellow ), mGrid( 3 ), mMenuBorderedBG( 0 ), |
50 | mMenuTiledBG( 0 ) | 50 | mMenuTiledBG( 0 ) |
51 | { | 51 | { |
52 | KToggleAction** actions[] = { | 52 | KToggleAction** actions[] = { |
53 | &mActionShowAddresses, | 53 | &mActionShowAddresses, |
54 | &mActionShowEmails, | 54 | &mActionShowEmails, |
55 | &mActionShowPhones, | 55 | &mActionShowPhones, |
56 | &mActionShowURLs | 56 | &mActionShowURLs |
57 | }; | 57 | }; |
58 | 58 | ||
59 | QString actionTexts[] = { | 59 | QString actionTexts[] = { |
60 | i18n( "Show Postal Addresses" ), | 60 | i18n( "Show Postal Addresses" ), |
61 | i18n( "Show Email Addresses" ), | 61 | i18n( "Show Email Addresses" ), |
62 | i18n( "Show Telephone Numbers" ), | 62 | i18n( "Show Telephone Numbers" ), |
63 | i18n( "Show Web Pages (URLs)" ) | 63 | i18n( "Show Web Pages (URLs)" ) |
64 | }; | 64 | }; |
65 | 65 | ||
66 | QFont general = KGlobalSettings::generalFont(); | 66 | QFont general = KGlobalSettings::generalMaxFont(); |
67 | QFont fixed = KGlobalSettings::fixedFont(); | 67 | QFont fixed = KGlobalSettings::fixedFont(); |
68 | QString gfont = general.family(); | 68 | QString gfont = general.family(); |
69 | QString ffont = fixed.family(); | 69 | QString ffont = fixed.family(); |
70 | 70 | ||
71 | int gpointsize = general.pixelSize(); | 71 | int gpointsize = general.pixelSize(); |
72 | if ( gpointsize == -1 ) | 72 | if ( gpointsize == -1 ) |
73 | gpointsize = general.pointSize(); | 73 | gpointsize = general.pointSize(); |
74 | 74 | ||
75 | int fpointsize = fixed.pixelSize(); | 75 | int fpointsize = fixed.pixelSize(); |
76 | if ( fpointsize == -1 ) | 76 | if ( fpointsize == -1 ) |
77 | fpointsize = fixed.pointSize(); | 77 | fpointsize = fixed.pointSize(); |
78 | 78 | ||
79 | mPainter = new KABEntryPainter; | 79 | mPainter = new KABEntryPainter; |
80 | 80 | ||
81 | mPainter->setForegroundColor( black ); | 81 | mPainter->setForegroundColor( black ); |
82 | mPainter->setHeaderColor( mHeadLineTextColor ); | 82 | mPainter->setHeaderColor( mHeadLineTextColor ); |
83 | mPainter->setUseHeaderColor( mUseHeadLineBGColor ); | 83 | mPainter->setUseHeaderColor( mUseHeadLineBGColor ); |
84 | mPainter->setBackgroundColor( mHeadLineBGColor ); | 84 | mPainter->setBackgroundColor( mHeadLineBGColor ); |
85 | 85 | ||
86 | mPainter->setHeaderFont( QFont( gfont, gpointsize + 4, QFont::Bold, true ) ); | 86 | mPainter->setHeaderFont( QFont( gfont, gpointsize + 4, QFont::Bold, true ) ); |
87 | mPainter->setHeadLineFont( QFont( gfont, gpointsize + 2, QFont::Bold, true ) ); | 87 | mPainter->setHeadLineFont( QFont( gfont, gpointsize + 2, QFont::Bold, true ) ); |
88 | mPainter->setBodyFont( QFont( gfont, gpointsize, QFont::Normal, false ) ); | 88 | mPainter->setBodyFont( QFont( gfont, gpointsize, QFont::Normal, false ) ); |
89 | mPainter->setFixedFont( QFont( ffont, fpointsize, QFont::Normal, false ) ); | 89 | mPainter->setFixedFont( QFont( ffont, fpointsize, QFont::Normal, false ) ); |
90 | mPainter->setCommentFont( QFont( gfont, gpointsize, QFont::Normal, false ) ); | 90 | mPainter->setCommentFont( QFont( gfont, gpointsize, QFont::Normal, false ) ); |
91 | 91 | ||
92 | const int numActions = sizeof( actions ) / sizeof( actions[ 0 ] ); | 92 | const int numActions = sizeof( actions ) / sizeof( actions[ 0 ] ); |
93 | 93 | ||
94 | for ( int count = 0; count < numActions; ++count ) { | 94 | for ( int count = 0; count < numActions; ++count ) { |
95 | *actions[ count ] = new KToggleAction( actionTexts[ count ] ); | 95 | *actions[ count ] = new KToggleAction( actionTexts[ count ] ); |
96 | (*actions[ count ])->setChecked( true ); | 96 | (*actions[ count ])->setChecked( true ); |
97 | } | 97 | } |
98 | 98 | ||
99 | setMouseTracking( true ); | 99 | setMouseTracking( true ); |
100 | 100 | ||
101 | setBackgroundMode( NoBackground ); | 101 | setBackgroundMode( NoBackground ); |
102 | } | 102 | } |
103 | 103 | ||
104 | KABDetailedView::~KABDetailedView() | 104 | KABDetailedView::~KABDetailedView() |
105 | { | 105 | { |
106 | delete mPainter; | 106 | delete mPainter; |
107 | mPainter = 0; | 107 | mPainter = 0; |
108 | } | 108 | } |
109 | 109 | ||
110 | bool KABDetailedView::getBackground( QString path, QPixmap& image ) | 110 | bool KABDetailedView::getBackground( QString path, QPixmap& image ) |
111 | { | 111 | { |
112 | QMap<QString, QPixmap>::iterator pos; | 112 | QMap<QString, QPixmap>::iterator pos; |
113 | 113 | ||
114 | pos = mBackgroundMap.find( path ); | 114 | pos = mBackgroundMap.find( path ); |