rendered paste bodyIndex: kdeui/widgets/ktitlewidget.cpp
===================================================================
--- kdeui/widgets/ktitlewidget.cpp (revision 742174)
+++ kdeui/widgets/ktitlewidget.cpp (working copy)
@@ -158,6 +158,15 @@
d->textLabel->setBuddy(buddy);
}
+void KTitleWidget::changeEvent(QEvent *e)
+{
+ QWidget::changeEvent(e);
+ if (e->type() == QEvent::PaletteChange) {
+ d->textLabel->setStyleSheet(d->textLabel->styleSheet());
+ d->commentLabel->setStyleSheet(d->commentLabel->styleSheet());
+ }
+}
+
void KTitleWidget::setText(const QString &text, Qt::Alignment alignment)
{
d->textLabel->setVisible(!text.isNull());
@@ -190,11 +199,7 @@
case InfoMessage:
case WarningMessage:
case ErrorMessage:
- styleSheet = QString("QLabel { font-color: %1; background: %2 }")
- .arg(palette().color(QPalette::Active,
- QPalette::HighlightedText).name(),
- palette().color(QPalette::Active,
- QPalette::Highlight).name());
+ styleSheet = QString("QLabel { font-color: palette(highlighted-text); background: palette(highlight); }");
break;
case PlainMessage:
default:
Index: kdeui/widgets/ktitlewidget.h
===================================================================
--- kdeui/widgets/ktitlewidget.h (revision 742174)
+++ kdeui/widgets/ktitlewidget.h (working copy)
@@ -193,6 +193,7 @@
void setAutoHideTimeout(int msecs);
protected:
+ void changeEvent(QEvent *e);
void showEvent(QShowEvent *event);
bool eventFilter(QObject *object, QEvent *event);