mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Config: Port remaining Interface settings to new config system.
This commit is contained in:
@ -22,7 +22,6 @@
|
||||
#include <imgui.h>
|
||||
|
||||
#include "Core/Config/MainSettings.h"
|
||||
#include "Core/ConfigManager.h"
|
||||
#include "Core/Core.h"
|
||||
#include "Core/State.h"
|
||||
|
||||
@ -156,14 +155,14 @@ void RenderWidget::UpdateCursor()
|
||||
// on top of the game window in the background
|
||||
const bool keep_on_top = (windowFlags() & Qt::WindowStaysOnTopHint) != 0;
|
||||
const bool should_hide =
|
||||
(Settings::Instance().GetCursorVisibility() == SConfig::ShowCursor::Never) &&
|
||||
(Settings::Instance().GetCursorVisibility() == Config::ShowCursor::Never) &&
|
||||
(keep_on_top || Config::Get(Config::MAIN_INPUT_BACKGROUND_INPUT) || isActiveWindow());
|
||||
setCursor(should_hide ? Qt::BlankCursor : Qt::ArrowCursor);
|
||||
}
|
||||
else
|
||||
{
|
||||
setCursor((m_cursor_locked &&
|
||||
Settings::Instance().GetCursorVisibility() == SConfig::ShowCursor::Never) ?
|
||||
Settings::Instance().GetCursorVisibility() == Config::ShowCursor::Never) ?
|
||||
Qt::BlankCursor :
|
||||
Qt::ArrowCursor);
|
||||
}
|
||||
@ -189,7 +188,7 @@ void RenderWidget::HandleCursorTimer()
|
||||
if (!isActiveWindow())
|
||||
return;
|
||||
if ((!Settings::Instance().GetLockCursor() || m_cursor_locked) &&
|
||||
Settings::Instance().GetCursorVisibility() == SConfig::ShowCursor::OnMovement)
|
||||
Settings::Instance().GetCursorVisibility() == Config::ShowCursor::OnMovement)
|
||||
{
|
||||
setCursor(Qt::BlankCursor);
|
||||
}
|
||||
@ -272,7 +271,7 @@ void RenderWidget::SetCursorLocked(bool locked, bool follow_aspect_ratio)
|
||||
{
|
||||
m_cursor_locked = true;
|
||||
|
||||
if (Settings::Instance().GetCursorVisibility() != SConfig::ShowCursor::Constantly)
|
||||
if (Settings::Instance().GetCursorVisibility() != Config::ShowCursor::Constantly)
|
||||
{
|
||||
setCursor(Qt::BlankCursor);
|
||||
}
|
||||
@ -374,7 +373,7 @@ bool RenderWidget::event(QEvent* event)
|
||||
break;
|
||||
case QEvent::MouseMove:
|
||||
// Unhide on movement
|
||||
if (Settings::Instance().GetCursorVisibility() == SConfig::ShowCursor::OnMovement)
|
||||
if (Settings::Instance().GetCursorVisibility() == Config::ShowCursor::OnMovement)
|
||||
{
|
||||
setCursor(Qt::ArrowCursor);
|
||||
m_mouse_timer->start(MOUSE_HIDE_DELAY);
|
||||
@ -386,7 +385,7 @@ bool RenderWidget::event(QEvent* event)
|
||||
case QEvent::Show:
|
||||
// Don't do if "stay on top" changed (or was true)
|
||||
if (Settings::Instance().GetLockCursor() &&
|
||||
Settings::Instance().GetCursorVisibility() != SConfig::ShowCursor::Constantly &&
|
||||
Settings::Instance().GetCursorVisibility() != Config::ShowCursor::Constantly &&
|
||||
!m_dont_lock_cursor_on_show)
|
||||
{
|
||||
// Auto lock when this window is shown (it was hidden)
|
||||
@ -399,7 +398,7 @@ bool RenderWidget::event(QEvent* event)
|
||||
// Note that this event in Windows is not always aligned to the window that is highlighted,
|
||||
// it's the window that has keyboard and mouse focus
|
||||
case QEvent::WindowActivate:
|
||||
if (SConfig::GetInstance().m_PauseOnFocusLost && Core::GetState() == Core::State::Paused)
|
||||
if (Config::Get(Config::MAIN_PAUSE_ON_FOCUS_LOST) && Core::GetState() == Core::State::Paused)
|
||||
Core::SetState(Core::State::Running);
|
||||
|
||||
UpdateCursor();
|
||||
@ -421,7 +420,7 @@ bool RenderWidget::event(QEvent* event)
|
||||
|
||||
UpdateCursor();
|
||||
|
||||
if (SConfig::GetInstance().m_PauseOnFocusLost && Core::GetState() == Core::State::Running)
|
||||
if (Config::Get(Config::MAIN_PAUSE_ON_FOCUS_LOST) && Core::GetState() == Core::State::Running)
|
||||
{
|
||||
// If we are declared as the CPU thread, it means that the real CPU thread is waiting
|
||||
// for us to finish showing a panic alert (with that panic alert likely being the cause
|
||||
|
Reference in New Issue
Block a user