diff --git a/Source/Core/DolphinQt2/Config/LogConfigWidget.cpp b/Source/Core/DolphinQt2/Config/LogConfigWidget.cpp index 326eb50812..e8a28140d4 100644 --- a/Source/Core/DolphinQt2/Config/LogConfigWidget.cpp +++ b/Source/Core/DolphinQt2/Config/LogConfigWidget.cpp @@ -196,3 +196,8 @@ void LogConfigWidget::SaveSettings() LogManager::GetInstance()->SetEnable(type, enabled); } } + +void LogConfigWidget::closeEvent(QCloseEvent*) +{ + Settings::Instance().SetLogConfigVisible(false); +} diff --git a/Source/Core/DolphinQt2/Config/LogConfigWidget.h b/Source/Core/DolphinQt2/Config/LogConfigWidget.h index 94a0d241b6..0158b997b2 100644 --- a/Source/Core/DolphinQt2/Config/LogConfigWidget.h +++ b/Source/Core/DolphinQt2/Config/LogConfigWidget.h @@ -7,6 +7,7 @@ #include class QCheckBox; +class QCloseEvent; class QListWidget; class QPushButton; class QRadioButton; @@ -19,6 +20,9 @@ public: explicit LogConfigWidget(QWidget* parent = nullptr); ~LogConfigWidget(); +protected: + void closeEvent(QCloseEvent* event) override; + private: void CreateWidgets(); void ConnectWidgets(); diff --git a/Source/Core/DolphinQt2/Config/LogWidget.cpp b/Source/Core/DolphinQt2/Config/LogWidget.cpp index d31203371e..e9293c22db 100644 --- a/Source/Core/DolphinQt2/Config/LogWidget.cpp +++ b/Source/Core/DolphinQt2/Config/LogWidget.cpp @@ -207,3 +207,8 @@ void LogWidget::Log(LogTypes::LOG_LEVELS level, const char* text) QString::fromStdString(color), QString::fromStdString(std::string(text).substr(TIMESTAMP_LENGTH)))); } + +void LogWidget::closeEvent(QCloseEvent*) +{ + Settings::Instance().SetLogVisible(false); +} diff --git a/Source/Core/DolphinQt2/Config/LogWidget.h b/Source/Core/DolphinQt2/Config/LogWidget.h index 193269d142..d116d8d02b 100644 --- a/Source/Core/DolphinQt2/Config/LogWidget.h +++ b/Source/Core/DolphinQt2/Config/LogWidget.h @@ -12,6 +12,7 @@ #include "Common/Logging/LogManager.h" class QCheckBox; +class QCloseEvent; class QComboBox; class QPushButton; class QVBoxLayout; @@ -25,6 +26,9 @@ public: explicit LogWidget(QWidget* parent = nullptr); ~LogWidget(); +protected: + void closeEvent(QCloseEvent*) override; + private: void UpdateLog(); void UpdateFont();