/* rendering */
connect( signalCollection, SIGNAL( redrawAllHTMLPart( bool ) ), SLOT( slotRedrawAllHTMLPart( bool ) ) );
connect( signalCollection, SIGNAL( threadFaceChanged() ), SLOT( slotSetFaceOfHTMLPart() ) );
- connect( signalCollection, SIGNAL( setStyleSheetOfHTMLPart() ), SLOT( slotSetStyleSheetOfHTMLPart() ) );
/* popup */
connect( this, SIGNAL( onURL( const QString& ) ), SLOT( slotOnURL( const QString& ) ) );
htmlDocument().applyChanges();
}
-/* public slot */
-void KitaHTMLPart::slotSetStyleSheetOfHTMLPart()
-{
- /* [0]<html> -> [1]<head> -> [2]<style> */
- DOM::HTMLCollection collection = htmlDocument().all();
- DOM::HTMLElement elm;
- unsigned int i;
- for ( i = 0 ; i < collection.length() ; i++ ) {
- elm = collection.item( i );
- if ( elm.tagName().upper() == "STYLE" ) {
- QString style = QString( "body { font-size: %1pt; font-family: %2; color: %3; background-color: %4; }" )
- .arg( Kita::Config::threadFont().pointSize() )
- .arg( Kita::Config::threadFont().family() )
- .arg( Kita::Config::threadColor().name() )
- .arg( Kita::Config::threadBackground().name() );
-
- QString style0 = KitaConfig::defaultStyleSheetText();
- style0 += style;
- if ( Kita::Config::useStyleSheet() ) {
- style0 += KitaConfig::styleSheetText();
- }
-
- elm.setInnerText( style0 );
- htmlDocument().applyChanges();
- break;
- }
- }
-}
-
/*---------------------------------------------------------------*/
/*---------------------------------------------------------------*/
/* cache functions */
/* rendering */
void slotRedrawAllHTMLPart( bool force );
void slotSetFaceOfHTMLPart();
- void slotSetStyleSheetOfHTMLPart();
/* cache */
void slotReceiveData();
/* to : KitaHTMLPart */
void redrawAllHTMLPart( bool force );
- void setStyleSheetOfHTMLPart();
/*--------------------------------*/
connect( styleSheetText, SIGNAL( textChanged() ), SIGNAL( changed() ) );
connect( useStyleSheetCheckBox, SIGNAL( toggled( bool ) ), SIGNAL( changed() ) );
-
- connect( this, SIGNAL( setStyleSheetOfHTMLPart() ),
- signalCollection, SIGNAL( setStyleSheetOfHTMLPart() ) );
}
void FacePrefPage::apply()
Kita::Config::useStyleSheet() != useStyleSheetCheckBox->isChecked() ) {
KitaConfig::setStyleSheetText( styleSheetText->text() );
Kita::Config::setUseStyleSheet( useStyleSheetCheckBox->isChecked() );
- emit setStyleSheetOfHTMLPart();
}
}
void fontChanged( const QFont& );
void threadFaceChanged();
void changed();
- void setStyleSheetOfHTMLPart();
};
}
/* rendering */
connect( signalCollection, SIGNAL( threadFaceChanged() ), SLOT( slotSetFaceOfHTMLPart() ) );
- connect( signalCollection, SIGNAL( setStyleSheetOfHTMLPart() ), SLOT( slotSetStyleSheetOfHTMLPart() ) );
/* popup */
connect( this, SIGNAL( onURL( const QString& ) ), SLOT( slotOnURL( const QString& ) ) );
htmlDocument().applyChanges();
}
-void KitaPreviewPart::slotSetStyleSheetOfHTMLPart()
-{
- /* [0]<html> -> [1]<head> -> [2]<style> */
- DOM::HTMLCollection collection = htmlDocument().all();
- DOM::HTMLElement element;
- unsigned int i;
- for ( i = 0 ; i < collection.length() ; i++ ) {
- element = collection.item( i );
- if ( element.tagName().upper() == "STYLE" ) {
- QString style = QString( "body { font-size: %1pt; font-family: %2; color: %3; background-color: %4; }" )
- .arg( Kita::Config::threadFont().pointSize() )
- .arg( Kita::Config::threadFont().family() )
- .arg( Kita::Config::threadColor().name() )
- .arg( Kita::Config::threadBackground().name() );
-
- QString style0 = KitaConfig::defaultStyleSheetText();
- style0 += style;
- if ( Kita::Config::useStyleSheet() ) {
- style0 += KitaConfig::styleSheetText();
- }
-
- element.setInnerText( style0 );
- htmlDocument().applyChanges();
- break;
- }
- }
-}
-
/*
* @Override
*/
/* rendering */
void slotSetFaceOfHTMLPart();
- void slotSetStyleSheetOfHTMLPart();
/* res popup */
void slotDeletePopup();