diff --git a/Source/Core/DolphinQt2/Settings.cpp b/Source/Core/DolphinQt2/Settings.cpp index a1ec7d7b94..824c001b59 100644 --- a/Source/Core/DolphinQt2/Settings.cpp +++ b/Source/Core/DolphinQt2/Settings.cpp @@ -213,6 +213,17 @@ QSize Settings::GetRenderWindowSize() const return value(QStringLiteral("Graphics/RenderWindowSize"), QSize(640, 480)).toSize(); } +void Settings::SetHideCursor(bool hide_cursor) +{ + SConfig::GetInstance().bHideCursor = hide_cursor; + emit HideCursorChanged(); +} + +bool Settings::GetHideCursor() const +{ + return SConfig::GetInstance().bHideCursor; +} + bool& Settings::BannerVisible() const { return SConfig::GetInstance().m_showBannerColumn; diff --git a/Source/Core/DolphinQt2/Settings.h b/Source/Core/DolphinQt2/Settings.h index d7f3dae319..8a8e79196a 100644 --- a/Source/Core/DolphinQt2/Settings.h +++ b/Source/Core/DolphinQt2/Settings.h @@ -71,6 +71,8 @@ public: bool GetRenderToMain() const; bool GetFullScreen() const; QSize GetRenderWindowSize() const; + void SetHideCursor(bool hide_cursor); + bool GetHideCursor() const; // Columns bool& BannerVisible() const; @@ -111,6 +113,7 @@ public: signals: void PathAdded(const QString&); void PathRemoved(const QString&); + void HideCursorChanged(); private: Settings(); diff --git a/Source/Core/DolphinQt2/Settings/InterfacePane.cpp b/Source/Core/DolphinQt2/Settings/InterfacePane.cpp index bae33ad704..20f4e8dd1a 100644 --- a/Source/Core/DolphinQt2/Settings/InterfacePane.cpp +++ b/Source/Core/DolphinQt2/Settings/InterfacePane.cpp @@ -17,6 +17,8 @@ #include "Common/StringUtil.h" #include "Core/ConfigManager.h" +#include "DolphinQt2/Settings.h" + InterfacePane::InterfacePane(QWidget* parent) : QWidget(parent) { CreateLayout(); @@ -113,7 +115,8 @@ void InterfacePane::ConnectLayout() connect(m_checkbox_use_panic_handlers, &QCheckBox::clicked, this, &InterfacePane::OnSaveConfig); connect(m_checkbox_enable_osd, &QCheckBox::clicked, this, &InterfacePane::OnSaveConfig); connect(m_checkbox_pause_on_focus_lost, &QCheckBox::clicked, this, &InterfacePane::OnSaveConfig); - connect(m_checkbox_hide_mouse, &QCheckBox::clicked, this, &InterfacePane::OnSaveConfig); + connect(m_checkbox_hide_mouse, &QCheckBox::clicked, &Settings::Instance(), + &Settings::SetHideCursor); } void InterfacePane::LoadConfig() @@ -131,7 +134,7 @@ void InterfacePane::LoadConfig() m_checkbox_enable_osd->setChecked(startup_params.bOnScreenDisplayMessages); m_checkbox_show_active_title->setChecked(startup_params.m_show_active_title); m_checkbox_pause_on_focus_lost->setChecked(startup_params.m_PauseOnFocusLost); - m_checkbox_hide_mouse->setChecked(startup_params.bHideCursor); + m_checkbox_hide_mouse->setChecked(Settings::Instance().GetHideCursor()); } void InterfacePane::OnSaveConfig() @@ -148,7 +151,6 @@ void InterfacePane::OnSaveConfig() settings.bOnScreenDisplayMessages = m_checkbox_enable_osd->isChecked(); settings.m_show_active_title = m_checkbox_show_active_title->isChecked(); settings.m_PauseOnFocusLost = m_checkbox_pause_on_focus_lost->isChecked(); - settings.bHideCursor = m_checkbox_hide_mouse->isChecked(); settings.SaveSettings(); }