diff options
Diffstat (limited to 'src/modules/notifier/notifiermessage.cpp')
| -rw-r--r-- | src/modules/notifier/notifiermessage.cpp | 53 |
1 files changed, 35 insertions, 18 deletions
diff --git a/src/modules/notifier/notifiermessage.cpp b/src/modules/notifier/notifiermessage.cpp index 2dec0919e..a5d69a1cd 100644 --- a/src/modules/notifier/notifiermessage.cpp +++ b/src/modules/notifier/notifiermessage.cpp @@ -34,18 +34,43 @@ KviNotifierMessage::KviNotifierMessage(QPixmap * pPixmap, const QString &szText) { - bool bShowImages=KVI_OPTION_BOOL(KviOption_boolIrcViewShowImages); + m_pLabel0 = 0; + m_pLabel1 = 0; + m_szText=szText; m_pPixmap=pPixmap; - m_pHBox = new QHBoxLayout(this); - m_pHBox->setSpacing(SPACING); - m_pHBox->setMargin(SPACING); - //QByteArray utf8 = szText.toUtf8(); //if(utf8.data()) // qDebug("NOTIFIER TEXT MESSAGE: \n%s\n",utf8.data()); + m_pHBox = new QHBoxLayout(this); + m_pHBox->setSpacing(SPACING); + m_pHBox->setMargin(SPACING); + + updateGui(); +} + +KviNotifierMessage::~KviNotifierMessage() +{ + if(m_pLabel0) + m_pLabel0->deleteLater(); + if(m_pLabel1) + m_pLabel1->deleteLater(); + if(m_pHBox) + m_pHBox->deleteLater(); +} + +void KviNotifierMessage::updateGui() +{ + bool bShowImages=KVI_OPTION_BOOL(KviOption_boolIrcViewShowImages); + + if(m_pLabel0) + delete m_pLabel0; + + if(m_pLabel1) + delete m_pLabel1; + if(bShowImages) { m_pLabel0 = new QLabel(this); @@ -56,28 +81,20 @@ KviNotifierMessage::KviNotifierMessage(QPixmap * pPixmap, const QString &szText) m_pLabel0 = 0; } - m_pLabel1 = new QLabel(this); m_pLabel1->setTextFormat(Qt::RichText); m_pLabel1->setText(KviHtmlGenerator::convertToHtml(m_szText)); m_pLabel1->setWordWrap(true); - + m_pLabel1->setFont(KVI_OPTION_FONT(KviOption_fontNotifier)); + QPalette pal = m_pLabel1->palette(); + pal.setColor(QPalette::WindowText, KVI_OPTION_COLOR(KviOption_colorNotifierForeground)); + m_pLabel1->setPalette(pal); + if(bShowImages) { m_pHBox->setStretch(1,99); m_pHBox->addWidget(m_pLabel0); } m_pHBox->addWidget(m_pLabel1); -} -KviNotifierMessage::~KviNotifierMessage() -{ - if(m_pLabel0) - m_pLabel0->deleteLater(); - if(m_pLabel1) - m_pLabel1->deleteLater(); - if(m_pHBox) - m_pHBox->deleteLater(); } - - |
