Don't destroy PopupMenu non-queued if !_useTransparency.
This commit is contained in:
parent
16f4aec946
commit
6abcbf773f
1 changed files with 14 additions and 4 deletions
|
|
@ -15,6 +15,7 @@
|
||||||
#include "ui/ui_utility.h"
|
#include "ui/ui_utility.h"
|
||||||
#include "ui/delayed_activation.h"
|
#include "ui/delayed_activation.h"
|
||||||
#include "ui/painter.h"
|
#include "ui/painter.h"
|
||||||
|
#include "base/invoke_queued.h"
|
||||||
#include "base/platform/base_platform_info.h"
|
#include "base/platform/base_platform_info.h"
|
||||||
|
|
||||||
#include <QtGui/QtEvents>
|
#include <QtGui/QtEvents>
|
||||||
|
|
@ -645,20 +646,29 @@ void PopupMenu::prepareCache() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupMenu::startOpacityAnimation(bool hiding) {
|
void PopupMenu::startOpacityAnimation(bool hiding) {
|
||||||
_hiding = false;
|
|
||||||
if (!_useTransparency) {
|
if (!_useTransparency) {
|
||||||
_a_opacity.stop();
|
_a_opacity.stop();
|
||||||
if (hiding) {
|
_hiding = hiding;
|
||||||
hideFinished();
|
if (_hiding) {
|
||||||
|
InvokeQueued(this, [=] {
|
||||||
|
if (_hiding) {
|
||||||
|
hideFinished();
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
_hiding = false;
|
||||||
prepareCache();
|
prepareCache();
|
||||||
_hiding = hiding;
|
_hiding = hiding;
|
||||||
hideChildren();
|
hideChildren();
|
||||||
_a_opacity.start([this] { opacityAnimationCallback(); }, _hiding ? 1. : 0., _hiding ? 0. : 1., _st.duration);
|
_a_opacity.start(
|
||||||
|
[=] { opacityAnimationCallback(); },
|
||||||
|
_hiding ? 1. : 0.,
|
||||||
|
_hiding ? 0. : 1.,
|
||||||
|
_st.duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupMenu::showStarted() {
|
void PopupMenu::showStarted() {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue