From cefb6e20c2e0ed55a0951ba37ffb8bdd475c420e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 17 Feb 2018 15:41:23 +0100 Subject: variant/default: fix close button with tray Using the close button must exit the program regardless of whether the tray is enabled. Restore that behavior. Reported-by: @albertolg Issue: #750 --- variant/default/main-window.cpp | 13 ------------- variant/default/main-window.hpp | 1 - 2 files changed, 14 deletions(-) (limited to 'variant') diff --git a/variant/default/main-window.cpp b/variant/default/main-window.cpp index 03e58af4..af9c6de2 100644 --- a/variant/default/main-window.cpp +++ b/variant/default/main-window.cpp @@ -886,19 +886,6 @@ void main_window::changeEvent(QEvent* e) e->ignore(); } -void main_window::closeEvent(QCloseEvent* ev) -{ - if (tray && tray->isVisible()) - { - ev->ignore(); - setVisible(false); - } - else - { - ev->accept(); - } -} - bool main_window::event(QEvent* event) { using t = QEvent::Type; diff --git a/variant/default/main-window.hpp b/variant/default/main-window.hpp index c69f1c0b..b4b7dbb7 100644 --- a/variant/default/main-window.hpp +++ b/variant/default/main-window.hpp @@ -97,7 +97,6 @@ class main_window : public QMainWindow, private State void init_tray(); void changeEvent(QEvent* e) override; - void closeEvent(QCloseEvent* ev) override; bool event(QEvent *event) override; bool maybe_hide_to_tray(QEvent* e); #if !defined _WIN32 && !defined __APPLE__ -- cgit v1.2.3