diff --git a/kmcomposerui.rc b/kmcomposerui.rc index b99189db0..67a957ad5 100644 --- a/kmcomposerui.rc +++ b/kmcomposerui.rc @@ -1,4 +1,4 @@ - + &Message @@ -93,6 +93,7 @@ + diff --git a/kmcomposewin.cpp b/kmcomposewin.cpp index 020cc6aa0..b2c848855 100644 --- a/kmcomposewin.cpp +++ b/kmcomposewin.cpp @@ -1166,8 +1166,11 @@ void KMComposeWin::setupActions(void) this, SLOT(slotTextItalic()), actionCollection(), "text_italic"); textUnderAction = new KToggleAction (i18n("&Under"), "text_under", 0, - this, SLOT(slotTextUnder()), - actionCollection(), "text_under"); + this, SLOT(slotTextUnder()), + actionCollection(), "text_under"); + actionFormatReset = new KAction( i18n( "Reset Font Settings" ), "eraser", 0, + this, SLOT( slotFormatReset() ), + actionCollection(), "format_reset"); actionFormatColor = new KAction( i18n( "Text Color..." ), "colorize", 0, this, SLOT( slotTextColor() ), actionCollection(), "format_color"); @@ -3109,6 +3112,10 @@ void KMComposeWin::slotToggleMarkup() if ( markupAction->isChecked() ) { toolBar("htmlToolBar")->show(); // markup will be toggled as soon as markup is actually used + fontChanged( mEditor->currentFont().family() ); // set buttons in correct position + fontAction->setFont( mEditor->currentFont().family() ); + fontSizeAction->setFontSize( mEditor->currentFont().pointSize() ); + mSaveFont = mEditor->currentFont(); } else toggleMarkup(false); @@ -3503,9 +3510,15 @@ void KMComposeWin::slotTextUnder() mEditor->QTextEdit::setUnderline( textUnderAction->isChecked() ); } +void KMComposeWin::slotFormatReset() +{ + mEditor->setColor(mForeColor); + mEditor->setCurrentFont( mSaveFont ); // fontChanged is called now +} void KMComposeWin::slotTextColor() { QColor color = mEditor->color(); + if ( KColorDialog::getColor( color ) ) { toggleMarkup(true); mEditor->setColor( color ); diff --git a/kmcomposewin.h b/kmcomposewin.h index 4bfffb116..9057219b2 100644 --- a/kmcomposewin.h +++ b/kmcomposewin.h @@ -547,6 +547,7 @@ public slots: void slotTextBold(); void slotTextItalic(); void slotTextUnder(); + void slotFormatReset(); void slotTextColor(); void fontChanged( const QFont & ); void alignmentChanged( int ); @@ -773,7 +774,7 @@ protected: KToggleAction *alignLeftAction, *alignCenterAction, *alignRightAction; KToggleAction *textBoldAction, *textItalicAction, *textUnderAction; KToggleAction *plainTextAction, *markupAction; - KAction *actionFormatColor; + KAction *actionFormatColor, *actionFormatReset; KAction *mHtmlToolbar; KSelectAction *mEncodingAction; @@ -807,6 +808,7 @@ private slots: private: QColor mForeColor,mBackColor; + QFont mSaveFont; struct atmLoadData { KURL url;