void KitaHTMLPart::createHTMLDocument()
{
/* style */
-#if 0
- QString style = QString( "style=\"font-size: %1pt; "
- "font-family: %2; "
- "color: %3; "
- "background-color: %4; border-width: 0; \"" )
+ QString style = QString( "body { font-size: %1pt; font-family: %2; }" )
.arg( KitaConfig::threadFont().pointSize() )
- .arg( KitaConfig::threadFont().family() )
+ .arg( KitaConfig::threadFont().family() );
+#if 0
.arg( KitaConfig::threadColor().name() )
.arg( KitaConfig::threadBackgroundColor().name() );
-
- QString text = "<html><head></head>";
- text += "<body " + style + "></body></html>";
-#else
- QString style = QString( "style=\"font-size: %1pt; "
- "font-family: %2; \"" )
- .arg( KitaConfig::threadFont().pointSize() )
- .arg( KitaConfig::threadFont().family() );
- QString text = "<html><head><style>";
- text += KitaConfig::styleSheetText();
- text += "</style></head><body " + style + "></body></html>";
#endif
+ QString text = "<html><head><style>";
+ text += KitaConfig::defaultStyleSheetText();
+ text += style;
+ if ( KitaConfig::useStyleSheet() ) {
+ text += KitaConfig::styleSheetText();
+ }
+ text += "</style></head><body></body></html>";
setJScriptEnabled( false );
setJavaEnabled( false );
elm = collection.item(i);
if(elm.tagName().upper() == "STYLE")
{
- elm.setInnerText( KitaConfig::styleSheetText() );
+ QString style = QString( "body { font-size: %1pt; font-family: %2; }" )
+ .arg( KitaConfig::threadFont().pointSize() )
+ .arg( KitaConfig::threadFont().family() );
+#if 0
+ .arg( KitaConfig::threadColor().name() )
+ .arg( KitaConfig::threadBackgroundColor().name() );
+#endif
+ QString style0 = KitaConfig::defaultStyleSheetText();
+ style0 += style;
+ if ( KitaConfig::useStyleSheet() ) {
+ style0 += KitaConfig::styleSheetText();
+ }
+
+ elm.setInnerText( style0 );
htmlDocument().applyChanges();
break;
}
/* top = centerNum - preShowNum
bottom = centerNum + afterShowNum
readNum = Kita::DatManager::getReadNum
-
+
No.1 <- show -> No.20 <- not show -> No.(top) <- show -> No.(bottom) <- not show -> No.(readNum) */
bool KitaHTMLPart::load( int centerNum )
void ResPopup::setText( const QString& str )
{
- QString style = QString( "style=\"font-size: %1pt; "
- "font-family: %2; "
- "border-width: 0; \"" )
+ QString style = QString( "body.pop {"
+ " font-size: %1pt; "
+ " font-family: %2; "
+ " color: %3; "
+ " background-color: %4; "
+ " border-width: 0;"
+ "}" )
.arg( KitaConfig::threadFont().pointSize() )
- .arg( KitaConfig::threadFont().family() );
+ .arg( KitaConfig::threadFont().family() )
+ .arg( KitaConfig::popupColor().name() )
+ .arg( KitaConfig::popupBackgroundColor().name() );
QString text = "<html><head><style>";
- text += KitaConfig::styleSheetText();
- text += "</style></head><body class=\"pop\" " + style + ">";
- text += str + "</body></html>";
+ text += KitaConfig::defaultStyleSheetText();
+ text += style;
+ if ( KitaConfig::useStyleSheet() ) {
+ text += KitaConfig::styleSheetText();
+ }
+ text += "</style></head><body class=\"pop\">";
+ text += str;
+ text += "</body></html>";
if( m_textBrowser ) m_textBrowser->setText( text );