mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-05-02 23:45:43 -04:00
Qt: Add option to hide the mouse cursor in fullscreen
This commit is contained in:
parent
a511882cb8
commit
0fbb69a3ef
@ -21,6 +21,8 @@ GeneralSettingsWidget::GeneralSettingsWidget(QtHostInterface* host_interface, QW
|
|||||||
false);
|
false);
|
||||||
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.startFullscreen, "Main", "StartFullscreen",
|
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.startFullscreen, "Main", "StartFullscreen",
|
||||||
false);
|
false);
|
||||||
|
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.hideCursorInFullscreen, "Main",
|
||||||
|
"HideCursorInFullscreen", true);
|
||||||
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.renderToMain, "Main", "RenderToMainWindow", true);
|
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.renderToMain, "Main", "RenderToMainWindow", true);
|
||||||
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.saveStateOnExit, "Main", "SaveStateOnExit", true);
|
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.saveStateOnExit, "Main", "SaveStateOnExit", true);
|
||||||
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.confirmPowerOff, "Main", "ConfirmPowerOff", true);
|
SettingWidgetBinder::BindWidgetToBoolSetting(m_host_interface, m_ui.confirmPowerOff, "Main", "ConfirmPowerOff", true);
|
||||||
@ -59,6 +61,8 @@ GeneralSettingsWidget::GeneralSettingsWidget(QtHostInterface* host_interface, QW
|
|||||||
"resume directly from where you left off next time."));
|
"resume directly from where you left off next time."));
|
||||||
dialog->registerWidgetHelp(m_ui.startFullscreen, tr("Start Fullscreen"), tr("Unchecked"),
|
dialog->registerWidgetHelp(m_ui.startFullscreen, tr("Start Fullscreen"), tr("Unchecked"),
|
||||||
tr("Automatically switches to fullscreen mode when a game is started."));
|
tr("Automatically switches to fullscreen mode when a game is started."));
|
||||||
|
dialog->registerWidgetHelp(m_ui.hideCursorInFullscreen, tr("Hide Cursor In Fullscreen"), tr("Checked"),
|
||||||
|
tr("Hides the mouse pointer/cursor when the emulator is in fullscreen mode."));
|
||||||
dialog->registerWidgetHelp(
|
dialog->registerWidgetHelp(
|
||||||
m_ui.renderToMain, tr("Render To Main Window"), tr("Checked"),
|
m_ui.renderToMain, tr("Render To Main Window"), tr("Checked"),
|
||||||
tr("Renders the display of the simulated console to the main window of the application, over "
|
tr("Renders the display of the simulated console to the main window of the application, over "
|
||||||
@ -92,7 +96,7 @@ GeneralSettingsWidget::GeneralSettingsWidget(QtHostInterface* host_interface, QW
|
|||||||
"to use XInput over SDL2 for compatibility."));
|
"to use XInput over SDL2 for compatibility."));
|
||||||
|
|
||||||
// Since this one is compile-time selected, we don't put it in the .ui file.
|
// Since this one is compile-time selected, we don't put it in the .ui file.
|
||||||
int current_col = 1;
|
int current_col = 0;
|
||||||
int current_row = m_ui.formLayout_4->rowCount() - current_col;
|
int current_row = m_ui.formLayout_4->rowCount() - current_col;
|
||||||
#ifdef WITH_DISCORD_PRESENCE
|
#ifdef WITH_DISCORD_PRESENCE
|
||||||
{
|
{
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="3" column="0">
|
||||||
<widget class="QCheckBox" name="renderToMain">
|
<widget class="QCheckBox" name="renderToMain">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Render To Main Window</string>
|
<string>Render To Main Window</string>
|
||||||
@ -74,27 +74,34 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="4" column="0">
|
||||||
<widget class="QCheckBox" name="applyGameSettings">
|
<widget class="QCheckBox" name="applyGameSettings">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Apply Per-Game Settings</string>
|
<string>Apply Per-Game Settings</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="4" column="1">
|
||||||
<widget class="QCheckBox" name="autoLoadCheats">
|
<widget class="QCheckBox" name="autoLoadCheats">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Automatically Load Cheats</string>
|
<string>Automatically Load Cheats</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="0">
|
<item row="3" column="1">
|
||||||
<widget class="QCheckBox" name="loadDevicesFromSaveStates">
|
<widget class="QCheckBox" name="loadDevicesFromSaveStates">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Load Devices From Save States</string>
|
<string>Load Devices From Save States</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QCheckBox" name="hideCursorInFullscreen">
|
||||||
|
<property name="text">
|
||||||
|
<string>Hide Cursor In Fullscreen</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -81,6 +81,11 @@ bool MainWindow::confirmMessage(const QString& message)
|
|||||||
return (result == QMessageBox::Yes);
|
return (result == QMessageBox::Yes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MainWindow::shouldHideCursorInFullscreen() const
|
||||||
|
{
|
||||||
|
return g_host_interface->GetBoolSettingValue("Main", "HideCursorInFullscreen", true);
|
||||||
|
}
|
||||||
|
|
||||||
QtDisplayWidget* MainWindow::createDisplay(QThread* worker_thread, const QString& adapter_name, bool use_debug_device,
|
QtDisplayWidget* MainWindow::createDisplay(QThread* worker_thread, const QString& adapter_name, bool use_debug_device,
|
||||||
bool fullscreen, bool render_to_main)
|
bool fullscreen, bool render_to_main)
|
||||||
{
|
{
|
||||||
@ -108,7 +113,8 @@ QtDisplayWidget* MainWindow::createDisplay(QThread* worker_thread, const QString
|
|||||||
else
|
else
|
||||||
m_display_widget->showNormal();
|
m_display_widget->showNormal();
|
||||||
|
|
||||||
m_display_widget->setCursor(Qt::BlankCursor);
|
if (shouldHideCursorInFullscreen())
|
||||||
|
m_display_widget->setCursor(Qt::BlankCursor);
|
||||||
}
|
}
|
||||||
else if (!render_to_main)
|
else if (!render_to_main)
|
||||||
{
|
{
|
||||||
@ -170,7 +176,9 @@ QtDisplayWidget* MainWindow::updateDisplay(QThread* worker_thread, bool fullscre
|
|||||||
m_display_widget->showFullScreen();
|
m_display_widget->showFullScreen();
|
||||||
else
|
else
|
||||||
m_display_widget->showNormal();
|
m_display_widget->showNormal();
|
||||||
m_display_widget->setCursor(Qt::BlankCursor);
|
|
||||||
|
if (shouldHideCursorInFullscreen())
|
||||||
|
m_display_widget->setCursor(Qt::BlankCursor);
|
||||||
}
|
}
|
||||||
else if (!render_to_main)
|
else if (!render_to_main)
|
||||||
{
|
{
|
||||||
|
@ -111,6 +111,7 @@ private:
|
|||||||
void restoreDisplayWindowGeometryFromConfig();
|
void restoreDisplayWindowGeometryFromConfig();
|
||||||
void destroyDisplayWidget();
|
void destroyDisplayWidget();
|
||||||
void setDisplayFullscreen(const std::string& fullscreen_mode);
|
void setDisplayFullscreen(const std::string& fullscreen_mode);
|
||||||
|
bool shouldHideCursorInFullscreen() const;
|
||||||
SettingsDialog* getSettingsDialog();
|
SettingsDialog* getSettingsDialog();
|
||||||
void doSettings(SettingsDialog::Category category = SettingsDialog::Category::Count);
|
void doSettings(SettingsDialog::Category category = SettingsDialog::Category::Count);
|
||||||
void updateDebugMenuCPUExecutionMode();
|
void updateDebugMenuCPUExecutionMode();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user