mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 10:22:48 +00:00
plasma: check the popup dialog visibility on status change too
because the status may change as the popup dialog is visible Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
32d4c73c53
commit
4869eb7bcc
2 changed files with 7 additions and 15 deletions
|
@ -327,13 +327,13 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints)
|
||||||
//kDebug() << "about to switch to a popup";
|
//kDebug() << "about to switch to a popup";
|
||||||
if (!qWidget && !gWidget) {
|
if (!qWidget && !gWidget) {
|
||||||
delete dialogPtr.data();
|
delete dialogPtr.data();
|
||||||
maybeStartAnimation();
|
statusChange(q->status());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//there was already a dialog? don't make the switch again
|
//there was already a dialog? don't make the switch again
|
||||||
if (dialogPtr) {
|
if (dialogPtr) {
|
||||||
maybeStartAnimation();
|
statusChange(q->status());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -406,7 +406,7 @@ void PopupAppletPrivate::popupConstraintsEvent(Plasma::Constraints constraints)
|
||||||
emit q->sizeHintChanged(Qt::PreferredSize);
|
emit q->sizeHintChanged(Qt::PreferredSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
maybeStartAnimation();
|
statusChange(q->status());
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupAppletPrivate::appletActivated()
|
void PopupAppletPrivate::appletActivated()
|
||||||
|
@ -765,6 +765,10 @@ void PopupAppletPrivate::statusChange(Plasma::ItemStatus status)
|
||||||
statusAnimation->setLoopCount(-1);
|
statusAnimation->setLoopCount(-1);
|
||||||
}
|
}
|
||||||
if (icon) {
|
if (icon) {
|
||||||
|
// not if the dialog is visible
|
||||||
|
if (dialogPtr && dialogPtr.data()->isVisible()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
statusAnimation->start(QAbstractAnimation::KeepWhenStopped);
|
statusAnimation->start(QAbstractAnimation::KeepWhenStopped);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -792,17 +796,6 @@ void PopupAppletPrivate::createIconWidget()
|
||||||
q->setLayout(layout);
|
q->setLayout(layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupAppletPrivate::maybeStartAnimation()
|
|
||||||
{
|
|
||||||
if (statusAnimation && q->status() == Plasma::ItemStatus::NeedsAttentionStatus) {
|
|
||||||
// not if the dialog is visible
|
|
||||||
if (dialogPtr && dialogPtr.data()->isVisible()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
statusAnimation->start(QAbstractAnimation::KeepWhenStopped);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void PopupAppletPrivate::restoreDialogSize()
|
void PopupAppletPrivate::restoreDialogSize()
|
||||||
{
|
{
|
||||||
Plasma::Dialog *dialog = dialogPtr.data();
|
Plasma::Dialog *dialog = dialogPtr.data();
|
||||||
|
|
|
@ -51,7 +51,6 @@ public:
|
||||||
void appletActivated();
|
void appletActivated();
|
||||||
void statusChange(Plasma::ItemStatus status);
|
void statusChange(Plasma::ItemStatus status);
|
||||||
void createIconWidget();
|
void createIconWidget();
|
||||||
void maybeStartAnimation();
|
|
||||||
|
|
||||||
PopupApplet *q;
|
PopupApplet *q;
|
||||||
Plasma::IconWidget *icon;
|
Plasma::IconWidget *icon;
|
||||||
|
|
Loading…
Add table
Reference in a new issue