Try to minimize problems arising from #418.
This commit is contained in:
parent
bc739ca9fa
commit
0fd3a6c8d3
@ -30,7 +30,7 @@
|
||||
<url type="donation">https://martinrotter.github.io/donate/</url>
|
||||
<content_rating type="oars-1.1" />
|
||||
<releases>
|
||||
<release version="3.9.2" date="2021-05-28"/>
|
||||
<release version="3.9.2" date="2021-05-31"/>
|
||||
</releases>
|
||||
<content_rating type="oars-1.0">
|
||||
<content_attribute id="violence-cartoon">none</content_attribute>
|
||||
|
@ -463,8 +463,16 @@ void FormMain::updateFeedButtonsAvailability() {
|
||||
void FormMain::switchVisibility(bool force_hide) {
|
||||
if (force_hide || isVisible()) {
|
||||
if (SystemTrayIcon::isSystemTrayDesired() && SystemTrayIcon::isSystemTrayAreaAvailable()) {
|
||||
|
||||
if (QApplication::activeModalWidget() != nullptr) {
|
||||
qApp->showGuiMessage(QSL(APP_LONG_NAME),
|
||||
tr("Close opened modal dialogs first."),
|
||||
QSystemTrayIcon::Warning, qApp->mainFormWidget(), true);
|
||||
}
|
||||
else {
|
||||
hide();
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Window gets minimized in single-window mode.
|
||||
showMinimized();
|
||||
|
@ -15,7 +15,7 @@
|
||||
TrayIconMenu::TrayIconMenu(const QString& title, QWidget* parent) : QMenu(title, parent) {}
|
||||
|
||||
bool TrayIconMenu::event(QEvent* event) {
|
||||
if (event->type() == QEvent::Show && Application::activeModalWidget() != nullptr) {
|
||||
if (event->type() == QEvent::Type::Show && Application::activeModalWidget() != nullptr) {
|
||||
QTimer::singleShot(0, this, &TrayIconMenu::hide);
|
||||
qApp->showGuiMessage(QSL(APP_LONG_NAME),
|
||||
tr("Close opened modal dialogs first."),
|
||||
|
Loading…
x
Reference in New Issue
Block a user