From af2752eb1c1dd5ba2459e3266593e834b2f6b684 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Sun, 4 Nov 2007 05:31:18 +0000 Subject: [PATCH] * make the error presentation look nicer. hopefully now frerich won't feel so compelled to pop up a dialog box. * invalidate the managing layout on geometry changes, which is what i expected it to do in the first place. calling setGeometry and then updateGeometry is just damaged CCMAIL:raabe@kde.org svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=732526 --- applet.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/applet.cpp b/applet.cpp index 8ec281b62..6cf9e588d 100644 --- a/applet.cpp +++ b/applet.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -606,7 +607,7 @@ QString visibleFailureText(const QString& reason) if (reason.isEmpty()) { text = i18n("This object could not be created."); } else { - text = i18n("This object could not be created for the following reason:

%1

", reason); + text = i18n("This object could not be created for the following reason:

%1

", reason); } return text; @@ -631,9 +632,12 @@ void Applet::setFailedToLaunch(bool failed, const QString& reason) setDrawStandardBackground(true); Layout* failureLayout = new BoxLayout(BoxLayout::TopToBottom, this); failureLayout->setMargin(0); - d->failureText = new LineEdit(this, scene()); - d->failureText->setFlags(0); + d->failureText = new LineEdit(this); + d->failureText->setStyled(false); + d->failureText->document()->setTextWidth(200); d->failureText->setHtml(visibleFailureText(reason)); + //FIXME: this needs to get the colour from the theme's colour scheme + d->failureText->setDefaultTextColor(Qt::white); failureLayout->addItem(d->failureText); setGeometry(QRectF(geometry().topLeft(), d->failureText->sizeHint())); } else { @@ -1139,6 +1143,10 @@ void Applet::setGeometry(const QRectF& geometry) if (layout()) { layout()->setGeometry(QRectF(QPoint(0, 0), contentSize())); } + + if (managingLayout()) { + managingLayout()->invalidate(); + } } setPos(geometry.topLeft());