37 #include "messagecore/settings/globalsettings.h"
40 #include <kconfiggroup.h>
42 #include <QMouseEvent>
44 using namespace MessageViewer;
50 setAlignment( Qt::AlignHCenter | Qt::AlignTop );
51 setAutoFillBackground(
true );
59 QPalette pal = palette();
60 pal.setColor( backgroundRole(), bgColor() );
61 pal.setColor( foregroundRole(), fgColor() );
64 setToolTip( toolTip() );
96 if ( event->button() == Qt::LeftButton ) {
101 QString HtmlStatusBar::message()
const {
105 return i18nc(
"'HTML Message' with html linebreaks between each letter and in bold text.",
106 "<qt><b><br />H<br />T<br />M<br />L<br /> "
107 "<br />M<br />e<br />s<br />s<br />a<br />g<br />e</b></qt>" );
109 return i18nc(
"'No HTML Message' with html linebreaks between each letter.",
110 "<qt><br />N<br />o<br /> "
111 "<br />H<br />T<br />M<br />L<br /> "
112 "<br />M<br />e<br />s<br />s<br />a<br />g<br />e</qt>" );
114 return i18nc(
"'Plain Message' with html linebreaks between each letter.",
115 "<qt><br />P<br />l<br />a<br />i<br />n<br /> "
116 "<br />M<br />e<br />s<br />s<br />a<br />g<br />e<br /></qt>" );
122 QString HtmlStatusBar::toolTip()
const
129 return i18n(
"Click to toggle between HTML and plain text." );
138 QColor HtmlStatusBar::fgColor()
const
141 QColor defaultColor, color;
145 defaultColor = Qt::white;
146 color = defaultColor;
147 if ( !MessageCore::GlobalSettings::self()->useDefaultColors() ) {
148 color = conf.readEntry(
"ColorbarForegroundHTML", defaultColor );
153 defaultColor = Qt::black;
154 color = defaultColor;
155 if ( !MessageCore::GlobalSettings::self()->useDefaultColors() ) {
156 color = conf.readEntry(
"ColorbarForegroundPlain", defaultColor );
164 QColor HtmlStatusBar::bgColor()
const {
167 QColor defaultColor, color;
171 defaultColor = Qt::black;
172 color = defaultColor;
173 if ( !MessageCore::GlobalSettings::self()->useDefaultColors() ) {
174 color = conf.readEntry(
"ColorbarBackgroundHTML", defaultColor );
179 defaultColor = Qt::lightGray;
180 color = defaultColor;
181 if ( !MessageCore::GlobalSettings::self()->useDefaultColors() ) {
182 color = conf.readEntry(
"ColorbarBackgroundPlain", defaultColor );
190 #include "htmlstatusbar.moc"
HtmlStatusBar(QWidget *parent=0)
HtmlMode
Describes the type of the displayed message.
A multipart/alternative message, the plain text part is currently displayed.
void setMode(Util::HtmlMode m, UpdateMode mode=Update)
Switch to mode m.
void setNormalMode()
Switch to "normal mode".
void mousePressEvent(QMouseEvent *event)
static GlobalSettings * self()
void setMultipartHtmlMode()
Switch to "multipart html mode".
A normal plaintext message, non-multipart.
A HTML message, non-multipart.
void clicked()
The user has clicked the status bar.
Util::HtmlMode mode() const
void setMultipartPlainMode()
Switch to "multipart plain mode".
A multipart/altervative message, the HTML part is currently displayed.