mirror of
https://github.com/tnodir/fort
synced 2024-11-15 08:35:08 +00:00
UI: HomeWindow: Don't activate menu on closing
This commit is contained in:
parent
2806813f48
commit
74e11cf323
@ -25,7 +25,7 @@ HomeWindow::HomeWindow(QWidget *parent) :
|
||||
setupStateWatcher();
|
||||
|
||||
connect(this, &HomeWindow::activationChanged, this, [&] {
|
||||
if (isActiveWindow()) {
|
||||
if (isActiveWindow() && !isClosing()) {
|
||||
m_btMenu->showMenu();
|
||||
}
|
||||
});
|
||||
|
@ -34,6 +34,8 @@ void WidgetWindow::hideEvent(QHideEvent *event)
|
||||
|
||||
void WidgetWindow::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
m_isClosing = true;
|
||||
|
||||
emit aboutToClose();
|
||||
|
||||
QWidget::closeEvent(event);
|
||||
|
@ -10,6 +10,8 @@ class WidgetWindow : public QWidget
|
||||
public:
|
||||
explicit WidgetWindow(QWidget *parent = nullptr);
|
||||
|
||||
bool isClosing() const { return m_isClosing; }
|
||||
|
||||
signals:
|
||||
void activationChanged();
|
||||
|
||||
@ -31,6 +33,9 @@ protected:
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
|
||||
void changeEvent(QEvent *event) override;
|
||||
|
||||
private:
|
||||
bool m_isClosing = false;
|
||||
};
|
||||
|
||||
#endif // WIDGETWINDOW_H
|
||||
|
Loading…
Reference in New Issue
Block a user