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();
}
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;

View File

@ -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();

View File

@ -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();
}