Add option for Never Hide Mouse Cursor

Instead of having a single GUI checkbox for "Always Hide Mouse Cursor",
I have instead opted to use radio buttons so the user can swap between
different states of mouse visibility. "Movement" is the default
behavior, "Never" will hide the mouse cursor the entire time the game is
running, and "Always" will keep the mouse cursor always visible.
This commit is contained in:
sowens99
2021-09-22 23:57:52 -04:00
parent 5145853351
commit 2aa400e72f
9 changed files with 99 additions and 36 deletions

View File

@ -10,6 +10,7 @@
#include <QFile>
#include <QFileInfo>
#include <QFontDatabase>
#include <QRadioButton>
#include <QSize>
#include <QWidget>
@ -325,15 +326,16 @@ void Settings::SetStateSlot(int slot)
GetQSettings().setValue(QStringLiteral("Emulation/StateSlot"), slot);
}
void Settings::SetHideCursor(bool hide_cursor)
void Settings::SetCursorVisibility(SConfig::ShowCursor hideCursor)
{
SConfig::GetInstance().bHideCursor = hide_cursor;
emit HideCursorChanged();
SConfig::GetInstance().m_show_cursor = hideCursor;
emit CursorVisibilityChanged();
}
bool Settings::GetHideCursor() const
SConfig::ShowCursor Settings::GetCursorVisibility() const
{
return SConfig::GetInstance().bHideCursor;
return SConfig::GetInstance().m_show_cursor;
}
void Settings::SetLockCursor(bool lock_cursor)