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:
parent
61a1ba4c92
commit
919796da14
26
applet.cpp
26
applet.cpp
@ -497,7 +497,7 @@ void AppletPrivate::cleanUpAndDelete()
|
|||||||
q->deleteLater();
|
q->deleteLater();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AppletPrivate::createMessageOverlay()
|
void AppletPrivate::createMessageOverlay(bool usePopup)
|
||||||
{
|
{
|
||||||
if (messageOverlay) {
|
if (messageOverlay) {
|
||||||
qDeleteAll(messageOverlay->children());
|
qDeleteAll(messageOverlay->children());
|
||||||
@ -507,21 +507,21 @@ void AppletPrivate::createMessageOverlay()
|
|||||||
PopupApplet *popup = qobject_cast<Plasma::PopupApplet*>(q);
|
PopupApplet *popup = qobject_cast<Plasma::PopupApplet*>(q);
|
||||||
|
|
||||||
if (!messageOverlay) {
|
if (!messageOverlay) {
|
||||||
if (popup && popup->widget()) {
|
if (usePopup && popup && popup->widget()) {
|
||||||
messageOverlayProxy = new QGraphicsProxyWidget(q);
|
messageOverlayProxy = new QGraphicsProxyWidget(q);
|
||||||
messageOverlayProxy->setWidget(popup->widget());
|
messageOverlayProxy->setWidget(popup->widget());
|
||||||
messageOverlay = new AppletOverlayWidget(messageOverlayProxy);
|
messageOverlay = new AppletOverlayWidget(messageOverlayProxy);
|
||||||
} else if (popup && popup->graphicsWidget()) {
|
} else if (usePopup && popup && popup->graphicsWidget()) {
|
||||||
messageOverlay = new AppletOverlayWidget(popup->graphicsWidget());
|
messageOverlay = new AppletOverlayWidget(popup->graphicsWidget());
|
||||||
} else {
|
} else {
|
||||||
messageOverlay = new AppletOverlayWidget(q);
|
messageOverlay = new AppletOverlayWidget(q);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (popup && popup->widget()) {
|
if (usePopup && popup && popup->widget()) {
|
||||||
// popupapplet with widget()
|
// popupapplet with widget()
|
||||||
messageOverlay->setGeometry(popup->widget()->contentsRect());
|
messageOverlay->setGeometry(popup->widget()->contentsRect());
|
||||||
} else if (popup && popup->graphicsWidget()) {
|
} else if (usePopup && popup && popup->graphicsWidget()) {
|
||||||
// popupapplet with graphicsWidget()
|
// popupapplet with graphicsWidget()
|
||||||
messageOverlay->setGeometry(popup->graphicsWidget()->boundingRect());
|
messageOverlay->setGeometry(popup->graphicsWidget()->boundingRect());
|
||||||
} else {
|
} else {
|
||||||
@ -683,8 +683,8 @@ Extender *Applet::extender() const
|
|||||||
void Applet::setBusy(bool busy)
|
void Applet::setBusy(bool busy)
|
||||||
{
|
{
|
||||||
if (busy) {
|
if (busy) {
|
||||||
d->createMessageOverlay();
|
d->createMessageOverlay(false);
|
||||||
d->messageOverlay->opacity = 0.4;
|
d->messageOverlay->opacity = 0;
|
||||||
|
|
||||||
QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(d->messageOverlay);
|
QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(d->messageOverlay);
|
||||||
d->busyWidget = new Plasma::BusyWidget(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()) {
|
if (d->started && layout()) {
|
||||||
layout()->updateGeometry();
|
layout()->updateGeometry();
|
||||||
}
|
}
|
||||||
@ -2349,6 +2342,11 @@ void AppletOverlayWidget::paint(QPainter *painter,
|
|||||||
{
|
{
|
||||||
Q_UNUSED(option)
|
Q_UNUSED(option)
|
||||||
Q_UNUSED(widget)
|
Q_UNUSED(widget)
|
||||||
|
|
||||||
|
if (qFuzzyCompare(1, 1+opacity)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QColor wash = Plasma::Theme::defaultTheme()->color(Theme::BackgroundColor);
|
QColor wash = Plasma::Theme::defaultTheme()->color(Theme::BackgroundColor);
|
||||||
wash.setAlphaF(opacity);
|
wash.setAlphaF(opacity);
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ public:
|
|||||||
void updateRect(const QRectF &rect);
|
void updateRect(const QRectF &rect);
|
||||||
void setFocus();
|
void setFocus();
|
||||||
void cleanUpAndDelete();
|
void cleanUpAndDelete();
|
||||||
void createMessageOverlay();
|
void createMessageOverlay(bool usePopup = true);
|
||||||
void destroyMessageOverlay();
|
void destroyMessageOverlay();
|
||||||
void addGlobalShortcutsPage(KConfigDialog *dialog);
|
void addGlobalShortcutsPage(KConfigDialog *dialog);
|
||||||
void clearShortcutEditorPtr();
|
void clearShortcutEditorPtr();
|
||||||
|
Loading…
Reference in New Issue
Block a user