diff --git a/csshelper.cpp b/csshelper.cpp index 3c3ef978a..2ea79c551 100644 --- a/csshelper.cpp +++ b/csshelper.cpp @@ -63,7 +63,7 @@ namespace KMail { void readColorConfig(); // returns CSS rules specific to the print media type - QString printCssDefinitions() const; + QString printCssDefinitions( bool fixed ) const; // returns CSS rules specific to the screen media type QString screenCssDefinitions( const CSSHelper * helper, bool fixed ) const; @@ -72,7 +72,8 @@ namespace KMail { QString commonCssDefinitions() const; QFont bodyFont( bool fixed, bool print=false ) const { - return fixed ? mFixedFont : print ? mPrintFont : mBodyFont ; + return fixed ? ( print ? mFixedPrintFont : mFixedFont ) + : ( print ? mPrintFont : mBodyFont ); } int fontSize( bool fixed, bool print=false ) const { return bodyFont( fixed, print ).pointSize(); @@ -81,7 +82,7 @@ namespace KMail { QString quoteFontTag( int level ) const; private: - QFont mBodyFont, mPrintFont, mFixedFont; + QFont mBodyFont, mPrintFont, mFixedFont, mFixedPrintFont; QFont mQuoteFont[3]; QColor mQuoteColor[3]; bool mRecycleQuoteColors; @@ -107,6 +108,7 @@ namespace KMail { mBodyFont == other.mBodyFont && mPrintFont == other.mPrintFont && mFixedFont == other.mFixedFont && + mFixedPrintFont == other.mFixedPrintFont && mRecycleQuoteColors == other.mRecycleQuoteColors && mBackingPixmapOn == other.mBackingPixmapOn && mBackingPixmapStr == other.mBackingPixmapStr && @@ -237,16 +239,18 @@ namespace KMail { } QFont defaultFont = KGlobalSettings::generalFont(); + QFont defaultFixedFont = KGlobalSettings::fixedFont(); if ( fonts.readBoolEntry( "defaultFonts", true ) ) { mBodyFont = mPrintFont = defaultFont; - mFixedFont = KGlobalSettings::fixedFont(); + mFixedFont = mFixedPrintFont = defaultFixedFont; defaultFont.setItalic( true ); for ( int i = 0 ; i < 3 ; ++i ) mQuoteFont[i] = defaultFont; } else { mBodyFont = fonts.readFontEntry( "body-font", &defaultFont); mPrintFont = fonts.readFontEntry( "print-font", &defaultFont); - mFixedFont = fonts.readFontEntry( "fixed-font", &defaultFont); + mFixedFont = fonts.readFontEntry( "fixed-font", &defaultFixedFont); + mFixedPrintFont = mFixedFont; // FIXME when we have a separate fixed print font defaultFont.setItalic( true ); for ( int i = 0 ; i < 3 ; ++i ) { const QString key = QString( "quote%1-font" ).arg( i+1 ); @@ -298,7 +302,7 @@ namespace KMail { "}\n" "@media print {\n\n" + - d->printCssDefinitions() + d->printCssDefinitions( fixed ) + "}\n"; } @@ -307,8 +311,7 @@ namespace KMail { return "\n" "