Settings: emit HideCursorChanged()

This commit is contained in:
Michael Maltese 2017-05-31 23:49:06 -07:00
parent 14da8232f6
commit 833e38ed56
3 changed files with 19 additions and 3 deletions

View File

@ -213,6 +213,17 @@ QSize Settings::GetRenderWindowSize() const
return value(QStringLiteral("Graphics/RenderWindowSize"), QSize(640, 480)).toSize(); 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 bool& Settings::BannerVisible() const
{ {
return SConfig::GetInstance().m_showBannerColumn; return SConfig::GetInstance().m_showBannerColumn;

View File

@ -71,6 +71,8 @@ public:
bool GetRenderToMain() const; bool GetRenderToMain() const;
bool GetFullScreen() const; bool GetFullScreen() const;
QSize GetRenderWindowSize() const; QSize GetRenderWindowSize() const;
void SetHideCursor(bool hide_cursor);
bool GetHideCursor() const;
// Columns // Columns
bool& BannerVisible() const; bool& BannerVisible() const;
@ -111,6 +113,7 @@ public:
signals: signals:
void PathAdded(const QString&); void PathAdded(const QString&);
void PathRemoved(const QString&); void PathRemoved(const QString&);
void HideCursorChanged();
private: private:
Settings(); Settings();

View File

@ -17,6 +17,8 @@
#include "Common/StringUtil.h" #include "Common/StringUtil.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "DolphinQt2/Settings.h"
InterfacePane::InterfacePane(QWidget* parent) : QWidget(parent) InterfacePane::InterfacePane(QWidget* parent) : QWidget(parent)
{ {
CreateLayout(); CreateLayout();
@ -113,7 +115,8 @@ void InterfacePane::ConnectLayout()
connect(m_checkbox_use_panic_handlers, &QCheckBox::clicked, this, &InterfacePane::OnSaveConfig); connect(m_checkbox_use_panic_handlers, &QCheckBox::clicked, this, &InterfacePane::OnSaveConfig);
connect(m_checkbox_enable_osd, &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_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() void InterfacePane::LoadConfig()
@ -131,7 +134,7 @@ void InterfacePane::LoadConfig()
m_checkbox_enable_osd->setChecked(startup_params.bOnScreenDisplayMessages); m_checkbox_enable_osd->setChecked(startup_params.bOnScreenDisplayMessages);
m_checkbox_show_active_title->setChecked(startup_params.m_show_active_title); 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_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() void InterfacePane::OnSaveConfig()
@ -148,7 +151,6 @@ void InterfacePane::OnSaveConfig()
settings.bOnScreenDisplayMessages = m_checkbox_enable_osd->isChecked(); settings.bOnScreenDisplayMessages = m_checkbox_enable_osd->isChecked();
settings.m_show_active_title = m_checkbox_show_active_title->isChecked(); settings.m_show_active_title = m_checkbox_show_active_title->isChecked();
settings.m_PauseOnFocusLost = m_checkbox_pause_on_focus_lost->isChecked(); settings.m_PauseOnFocusLost = m_checkbox_pause_on_focus_lost->isChecked();
settings.bHideCursor = m_checkbox_hide_mouse->isChecked();
settings.SaveSettings(); settings.SaveSettings();
} }