Send QCloseEvent to custom-closed Ui::Window-s.
This commit is contained in:
parent
d515956f76
commit
aeeb13bd02
1 changed files with 6 additions and 1 deletions
|
|
@ -202,8 +202,13 @@ void WindowHelper::Private::activateBeforeNativeMove() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowHelper::Private::close() {
|
void WindowHelper::Private::close() {
|
||||||
|
const auto weak = Ui::MakeWeak(_owner->window());
|
||||||
|
QCloseEvent e;
|
||||||
|
qApp->sendEvent(_owner->window(), &e);
|
||||||
|
if (e.isAccepted() && weak && _nativeWindow) {
|
||||||
[_nativeWindow close];
|
[_nativeWindow close];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Fn<void(bool)> WindowHelper::Private::toggleCustomTitleCallback() {
|
Fn<void(bool)> WindowHelper::Private::toggleCustomTitleCallback() {
|
||||||
return crl::guard(_owner->window(), [=](bool visible) {
|
return crl::guard(_owner->window(), [=](bool visible) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue