32 #include "csshelper.h"
35 #include "globalsettings.h"
37 #include <tdeconfig.h>
44 CSSHelper::CSSHelper(
const TQPaintDeviceMetrics &pdm ) :
45 KPIM::CSSHelper( pdm )
47 TDEConfig * config = KMKernel::config();
49 TDEConfigGroup reader( config,
"Reader" );
50 TDEConfigGroup fonts( config,
"Fonts" );
51 TDEConfigGroup pixmaps( config,
"Pixmaps" );
53 mRecycleQuoteColors = reader.readBoolEntry(
"RecycleQuoteColors",
false );
55 if ( !reader.readBoolEntry(
"defaultColors",
true ) ) {
56 mForegroundColor = reader.readColorEntry(
"ForegroundColor",&mForegroundColor);
57 mLinkColor = reader.readColorEntry(
"LinkColor",&mLinkColor);
58 mVisitedLinkColor = reader.readColorEntry(
"FollowedColor",&mVisitedLinkColor);
59 mBackgroundColor = reader.readColorEntry(
"BackgroundColor",&mBackgroundColor);
60 cPgpEncrH = reader.readColorEntry(
"PGPMessageEncr", &cPgpEncrH );
61 cPgpOk1H = reader.readColorEntry(
"PGPMessageOkKeyOk", &cPgpOk1H );
62 cPgpOk0H = reader.readColorEntry(
"PGPMessageOkKeyBad", &cPgpOk0H );
63 cPgpWarnH = reader.readColorEntry(
"PGPMessageWarn", &cPgpWarnH );
64 cPgpErrH = reader.readColorEntry(
"PGPMessageErr", &cPgpErrH );
65 cHtmlWarning = reader.readColorEntry(
"HTMLWarningColor", &cHtmlWarning );
66 for (
int i = 0 ; i < 3 ; ++i ) {
67 const TQString key =
"QuotedText" + TQString::number( i+1 );
68 mQuoteColor[i] = reader.readColorEntry( key, &mQuoteColor[i] );
72 if ( !fonts.readBoolEntry(
"defaultFonts",
true ) ) {
73 mBodyFont = fonts.readFontEntry(
"body-font", &mBodyFont);
74 mPrintFont = fonts.readFontEntry(
"print-font", &mPrintFont);
75 mFixedFont = fonts.readFontEntry(
"fixed-font", &mFixedFont);
76 mFixedPrintFont = mFixedFont;
77 TQFont defaultFont = mBodyFont;
78 defaultFont.setItalic(
true );
79 for (
int i = 0 ; i < 3 ; ++i ) {
80 const TQString key = TQString(
"quote%1-font" ).arg( i+1 );
81 mQuoteFont[i] = fonts.readFontEntry( key, &defaultFont );
85 mShrinkQuotes = GlobalSettings::self()->shrinkQuotes();
87 mBackingPixmapStr = pixmaps.readPathEntry(
"Readerwin");
88 mBackingPixmapOn = !mBackingPixmapStr.isEmpty();
90 recalculatePGPColors();