0 opacity with the busywidget

busywidget always on the icon rather in the popup

svn path=/trunk/KDE/kdelibs/; revision=936025
This commit is contained in:
Marco Martin 2009-03-06 18:21:59 +00:00
parent 61a1ba4c92
commit 919796da14
2 changed files with 13 additions and 15 deletions

View File

@ -497,7 +497,7 @@ void AppletPrivate::cleanUpAndDelete()
q->deleteLater();
}
void AppletPrivate::createMessageOverlay()
void AppletPrivate::createMessageOverlay(bool usePopup)
{
if (messageOverlay) {
qDeleteAll(messageOverlay->children());
@ -507,21 +507,21 @@ void AppletPrivate::createMessageOverlay()
PopupApplet *popup = qobject_cast<Plasma::PopupApplet*>(q);
if (!messageOverlay) {
if (popup && popup->widget()) {
if (usePopup && popup && popup->widget()) {
messageOverlayProxy = new QGraphicsProxyWidget(q);
messageOverlayProxy->setWidget(popup->widget());
messageOverlay = new AppletOverlayWidget(messageOverlayProxy);
} else if (popup && popup->graphicsWidget()) {
} else if (usePopup && popup && popup->graphicsWidget()) {
messageOverlay = new AppletOverlayWidget(popup->graphicsWidget());
} else {
messageOverlay = new AppletOverlayWidget(q);
}
}
if (popup && popup->widget()) {
if (usePopup && popup && popup->widget()) {
// popupapplet with widget()
messageOverlay->setGeometry(popup->widget()->contentsRect());
} else if (popup && popup->graphicsWidget()) {
} else if (usePopup && popup && popup->graphicsWidget()) {
// popupapplet with graphicsWidget()
messageOverlay->setGeometry(popup->graphicsWidget()->boundingRect());
} else {
@ -683,8 +683,8 @@ Extender *Applet::extender() const
void Applet::setBusy(bool busy)
{
if (busy) {
d->createMessageOverlay();
d->messageOverlay->opacity = 0.4;
d->createMessageOverlay(false);
d->messageOverlay->opacity = 0;
QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(d->messageOverlay);
d->busyWidget = new Plasma::BusyWidget(d->messageOverlay);
@ -1077,13 +1077,6 @@ void Applet::flushPendingConstraintsEvents()
}*/
}
if (d->busyWidget && d->busyWidget->isVisible()) {
int busySize = qMin(size().width(), size().height())/3;
QRect busyRect(0, 0, busySize, busySize);
busyRect.moveCenter(boundingRect().center().toPoint());
d->busyWidget->setGeometry(busyRect);
}
if (d->started && layout()) {
layout()->updateGeometry();
}
@ -2349,6 +2342,11 @@ void AppletOverlayWidget::paint(QPainter *painter,
{
Q_UNUSED(option)
Q_UNUSED(widget)
if (qFuzzyCompare(1, 1+opacity)) {
return;
}
QColor wash = Plasma::Theme::defaultTheme()->color(Theme::BackgroundColor);
wash.setAlphaF(opacity);

View File

@ -82,7 +82,7 @@ public:
void updateRect(const QRectF &rect);
void setFocus();
void cleanUpAndDelete();
void createMessageOverlay();
void createMessageOverlay(bool usePopup = true);
void destroyMessageOverlay();
void addGlobalShortcutsPage(KConfigDialog *dialog);
void clearShortcutEditorPtr();