From 9e0546db06607960535102647273f32a7b2bfda1 Mon Sep 17 00:00:00 2001 From: charlesthobe Date: Sun, 2 Jul 2023 13:43:29 +0300 Subject: [PATCH] scroll --- pcsx2-qt/CMakeLists.txt | 4 + pcsx2-qt/CustomQtWidgets/NoScrollQComboBox.h | 16 + .../CustomQtWidgets/NoScrollQDoubleSpinBox.h | 16 + pcsx2-qt/CustomQtWidgets/NoScrollQSpinBox.h | 16 + pcsx2-qt/Debugger/CpuWidget.cpp | 2 +- pcsx2-qt/Debugger/CpuWidget.ui | 7 +- pcsx2-qt/GameList/GameListWidget.cpp | 4 +- pcsx2-qt/GameList/GameListWidget.ui | 11 +- pcsx2-qt/QtUtils.cpp | 2 +- pcsx2-qt/QtUtils.h | 2 +- pcsx2-qt/SettingWidgetBinder.h | 160 +- pcsx2-qt/Settings/AdvancedSettingsWidget.cpp | 6 +- pcsx2-qt/Settings/AdvancedSettingsWidget.ui | 28 +- pcsx2-qt/Settings/AudioSettingsWidget.cpp | 8 +- pcsx2-qt/Settings/AudioSettingsWidget.ui | 19 +- pcsx2-qt/Settings/ControllerBindingWidget.ui | 9 +- .../Settings/ControllerBindingWidgets.cpp | 22 +- .../Settings/ControllerSettingWidgetBinder.h | 6 +- .../Settings/ControllerSettingsDialog.cpp | 2 +- pcsx2-qt/Settings/ControllerSettingsDialog.ui | 9 +- pcsx2-qt/Settings/DEV9SettingsWidget.cpp | 30 +- pcsx2-qt/Settings/DEV9SettingsWidget.h | 2 +- pcsx2-qt/Settings/DEV9SettingsWidget.ui | 22 +- pcsx2-qt/Settings/DebugSettingsWidget.ui | 11 +- pcsx2-qt/Settings/EmulationSettingsWidget.cpp | 8 +- pcsx2-qt/Settings/EmulationSettingsWidget.h | 4 +- pcsx2-qt/Settings/EmulationSettingsWidget.ui | 26 +- pcsx2-qt/Settings/GameSummaryWidget.cpp | 2 +- pcsx2-qt/Settings/GameSummaryWidget.ui | 15 +- pcsx2-qt/Settings/GraphicsSettingsWidget.cpp | 16 +- pcsx2-qt/Settings/GraphicsSettingsWidget.ui | 124 +- .../GraphicsSettingsWidget.ui.autosave | 1644 +++++++++++++++++ pcsx2-qt/Settings/InterfaceSettingsWidget.cpp | 4 +- pcsx2-qt/Settings/InterfaceSettingsWidget.ui | 13 +- pcsx2-qt/Settings/MemoryCardConvertDialog.cpp | 2 +- pcsx2-qt/Settings/MemoryCardConvertDialog.ui | 9 +- pcsx2-qt/Settings/USBDeviceWidget.ui | 11 +- pcsx2-qt/SetupWizardDialog.cpp | 6 +- pcsx2-qt/SetupWizardDialog.ui | 15 +- 39 files changed, 2066 insertions(+), 247 deletions(-) create mode 100644 pcsx2-qt/CustomQtWidgets/NoScrollQComboBox.h create mode 100644 pcsx2-qt/CustomQtWidgets/NoScrollQDoubleSpinBox.h create mode 100644 pcsx2-qt/CustomQtWidgets/NoScrollQSpinBox.h create mode 100644 pcsx2-qt/Settings/GraphicsSettingsWidget.ui.autosave diff --git a/pcsx2-qt/CMakeLists.txt b/pcsx2-qt/CMakeLists.txt index e7a4a11b5c1948..e713af67346f9f 100644 --- a/pcsx2-qt/CMakeLists.txt +++ b/pcsx2-qt/CMakeLists.txt @@ -133,6 +133,9 @@ target_sources(pcsx2-qt PRIVATE Settings/SettingsDialog.ui Settings/USBBindingWidget_DrivingForce.ui Settings/USBBindingWidget_GTForce.ui + CustomQtWidgets/NoScrollQComboBox.h + CustomQtWidgets/NoScrollQDoubleSpinBox.h + CustomQtWidgets/NoScrollQSpinBox.h Debugger/CpuWidget.cpp Debugger/CpuWidget.h Debugger/CpuWidget.ui @@ -186,6 +189,7 @@ target_include_directories(pcsx2-qt PRIVATE "${CMAKE_BINARY_DIR}/common/include" "${CMAKE_SOURCE_DIR}/pcsx2" "${CMAKE_SOURCE_DIR}/pcsx2-qt" + "${CMAKE_SOURCE_DIR}/pcsx2-qt/CustomQtWidgets" ) target_link_libraries(pcsx2-qt PRIVATE diff --git a/pcsx2-qt/CustomQtWidgets/NoScrollQComboBox.h b/pcsx2-qt/CustomQtWidgets/NoScrollQComboBox.h new file mode 100644 index 00000000000000..ad1865f7f7489b --- /dev/null +++ b/pcsx2-qt/CustomQtWidgets/NoScrollQComboBox.h @@ -0,0 +1,16 @@ +#pragma once +#include + +class NoScrollQComboBox : public QComboBox +{ + Q_OBJECT + void wheelEvent(QWheelEvent* event) override + { + ((QEvent*)event)->ignore(); + }; +public: + explicit NoScrollQComboBox(QWidget *parent = nullptr) : QComboBox(parent) + { + this->setFocusPolicy(Qt::StrongFocus); + } +}; diff --git a/pcsx2-qt/CustomQtWidgets/NoScrollQDoubleSpinBox.h b/pcsx2-qt/CustomQtWidgets/NoScrollQDoubleSpinBox.h new file mode 100644 index 00000000000000..9e98f9e33a50ca --- /dev/null +++ b/pcsx2-qt/CustomQtWidgets/NoScrollQDoubleSpinBox.h @@ -0,0 +1,16 @@ +#pragma once +#include + +class NoScrollQDoubleSpinBox : public QDoubleSpinBox +{ + Q_OBJECT + void wheelEvent(QWheelEvent* event) override + { + ((QEvent*)event)->ignore(); + }; +public: + explicit NoScrollQDoubleSpinBox(QWidget *parent = nullptr) : QDoubleSpinBox(parent) + { + this->setFocusPolicy(Qt::StrongFocus); + } +}; diff --git a/pcsx2-qt/CustomQtWidgets/NoScrollQSpinBox.h b/pcsx2-qt/CustomQtWidgets/NoScrollQSpinBox.h new file mode 100644 index 00000000000000..1a6330d0ac4630 --- /dev/null +++ b/pcsx2-qt/CustomQtWidgets/NoScrollQSpinBox.h @@ -0,0 +1,16 @@ +#pragma once +#include + +class NoScrollQSpinBox : public QSpinBox +{ + Q_OBJECT + void wheelEvent(QWheelEvent* event) override + { + ((QEvent*)event)->ignore(); + }; +public: + explicit NoScrollQSpinBox(QWidget *parent = nullptr) : QSpinBox(parent) + { + this->setFocusPolicy(Qt::StrongFocus); + } +}; diff --git a/pcsx2-qt/Debugger/CpuWidget.cpp b/pcsx2-qt/Debugger/CpuWidget.cpp index f93b6834b56ab2..ecf6bb42940508 100644 --- a/pcsx2-qt/Debugger/CpuWidget.cpp +++ b/pcsx2-qt/Debugger/CpuWidget.cpp @@ -85,7 +85,7 @@ CpuWidget::CpuWidget(QWidget* parent, DebugInterface& cpu) connect(m_ui.btnSearch, &QPushButton::clicked, this, &CpuWidget::onSearchButtonClicked); connect(m_ui.listSearchResults, &QListWidget::itemDoubleClicked, [this](QListWidgetItem* item) { m_ui.memoryviewWidget->gotoAddress(item->data(256).toUInt()); }); - connect(m_ui.cmbSearchType, &QComboBox::currentIndexChanged, [this](int i) { + connect(m_ui.cmbSearchType, &NoScrollQComboBox::currentIndexChanged, [this](int i) { if (i < 4) m_ui.chkSearchHex->setEnabled(true); else diff --git a/pcsx2-qt/Debugger/CpuWidget.ui b/pcsx2-qt/Debugger/CpuWidget.ui index d6324a8eac95cb..7e7128e6fd0cc4 100644 --- a/pcsx2-qt/Debugger/CpuWidget.ui +++ b/pcsx2-qt/Debugger/CpuWidget.ui @@ -195,7 +195,7 @@ - + 1 Byte (8 bits) @@ -524,6 +524,11 @@
pcsx2-qt/Debugger/MemoryViewWidget.h
1 + + NoScrollQComboBox + QComboBox +
NoScrollQComboBox.h
+
diff --git a/pcsx2-qt/GameList/GameListWidget.cpp b/pcsx2-qt/GameList/GameListWidget.cpp index f7d274dcb7811a..a42be7b340cdec 100644 --- a/pcsx2-qt/GameList/GameListWidget.cpp +++ b/pcsx2-qt/GameList/GameListWidget.cpp @@ -139,10 +139,10 @@ void GameListWidget::initialize() connect(m_ui.viewGameGrid, &QPushButton::clicked, this, &GameListWidget::showGameGrid); connect(m_ui.gridScale, &QSlider::valueChanged, this, &GameListWidget::gridIntScale); connect(m_ui.viewGridTitles, &QPushButton::toggled, this, &GameListWidget::setShowCoverTitles); - connect(m_ui.filterType, &QComboBox::currentIndexChanged, this, [this](int index) { + connect(m_ui.filterType, &NoScrollQComboBox::currentIndexChanged, this, [this](int index) { m_sort_model->setFilterType((index == 0) ? GameList::EntryType::Count : static_cast(index - 1)); }); - connect(m_ui.filterRegion, &QComboBox::currentIndexChanged, this, [this](int index) { + connect(m_ui.filterRegion, &NoScrollQComboBox::currentIndexChanged, this, [this](int index) { m_sort_model->setFilterRegion((index == 0) ? GameList::Region::Count : static_cast(index - 1)); }); connect(m_ui.searchText, &QLineEdit::textChanged, this, [this](const QString& text) { diff --git a/pcsx2-qt/GameList/GameListWidget.ui b/pcsx2-qt/GameList/GameListWidget.ui index 0602bcc7433827..8d77722df684d6 100644 --- a/pcsx2-qt/GameList/GameListWidget.ui +++ b/pcsx2-qt/GameList/GameListWidget.ui @@ -163,7 +163,7 @@ 6
- + All Types @@ -176,7 +176,7 @@ - + All Regions @@ -213,6 +213,13 @@ + + + NoScrollQComboBox + QComboBox +
NoScrollQComboBox.h
+
+
diff --git a/pcsx2-qt/QtUtils.cpp b/pcsx2-qt/QtUtils.cpp index 14b1e58ac0d904..28e953cb1bb42b 100644 --- a/pcsx2-qt/QtUtils.cpp +++ b/pcsx2-qt/QtUtils.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include "CustomQtWidgets/NoScrollQComboBox.h" #include #include #include diff --git a/pcsx2-qt/QtUtils.h b/pcsx2-qt/QtUtils.h index a657bca5996265..fe57b18f2f9701 100644 --- a/pcsx2-qt/QtUtils.h +++ b/pcsx2-qt/QtUtils.h @@ -28,7 +28,7 @@ class ByteStream; class QAction; -class QComboBox; +class NoScrollQComboBox; class QFrame; class QKeyEvent; class QTableView; diff --git a/pcsx2-qt/SettingWidgetBinder.h b/pcsx2-qt/SettingWidgetBinder.h index 17b300b5a6f7cf..3efdb646e8a4a9 100644 --- a/pcsx2-qt/SettingWidgetBinder.h +++ b/pcsx2-qt/SettingWidgetBinder.h @@ -23,14 +23,14 @@ #include #include #include -#include -#include +#include "CustomQtWidgets/NoScrollQComboBox.h" +#include "CustomQtWidgets/NoScrollQDoubleSpinBox.h" #include #include #include #include #include -#include +#include "CustomQtWidgets/NoScrollQSpinBox.h" #include "common/Path.h" @@ -116,13 +116,13 @@ namespace SettingWidgetBinder }; template <> - struct SettingAccessor + struct SettingAccessor { - static bool isNullValue(const QComboBox* widget) { return (widget->currentIndex() == 0); } + static bool isNullValue(const NoScrollQComboBox* widget) { return (widget->currentIndex() == 0); } - static bool getBoolValue(const QComboBox* widget) { return widget->currentIndex() > 0; } - static void setBoolValue(QComboBox* widget, bool value) { widget->setCurrentIndex(value ? 1 : 0); } - static void makeNullableBool(QComboBox* widget, bool globalValue) + static bool getBoolValue(const NoScrollQComboBox* widget) { return widget->currentIndex() > 0; } + static void setBoolValue(NoScrollQComboBox* widget, bool value) { widget->setCurrentIndex(value ? 1 : 0); } + static void makeNullableBool(NoScrollQComboBox* widget, bool globalValue) { //: THIS STRING IS SHARED ACROSS MULTIPLE OPTIONS. Be wary about gender/number. Also, ignore Crowdin's warning regarding [Enabled]: the text must be translated. widget->insertItem(0, globalValue ? qApp->translate("SettingsDialog", "Use Global Setting [Enabled]") : @@ -130,42 +130,42 @@ namespace SettingWidgetBinder qApp->translate("SettingsDialog", "Use Global Setting [Disabled]")); } - static int getIntValue(const QComboBox* widget) { return widget->currentIndex(); } - static void setIntValue(QComboBox* widget, int value) { widget->setCurrentIndex(value); } - static void makeNullableInt(QComboBox* widget, int globalValue) + static int getIntValue(const NoScrollQComboBox* widget) { return widget->currentIndex(); } + static void setIntValue(NoScrollQComboBox* widget, int value) { widget->setCurrentIndex(value); } + static void makeNullableInt(NoScrollQComboBox* widget, int globalValue) { widget->insertItem( 0, qApp->translate("SettingsDialog", "Use Global Setting [%1]") .arg((globalValue >= 0 && globalValue < widget->count()) ? widget->itemText(globalValue) : QString())); } - static std::optional getNullableIntValue(const QComboBox* widget) + static std::optional getNullableIntValue(const NoScrollQComboBox* widget) { return isNullValue(widget) ? std::nullopt : std::optional(widget->currentIndex() - 1); } - static void setNullableIntValue(QComboBox* widget, std::optional value) + static void setNullableIntValue(NoScrollQComboBox* widget, std::optional value) { widget->setCurrentIndex(value.has_value() ? (value.value() + 1) : 0); } - static float getFloatValue(const QComboBox* widget) { return static_cast(widget->currentIndex()); } - static void setFloatValue(QComboBox* widget, float value) { widget->setCurrentIndex(static_cast(value)); } - static void makeNullableFloat(QComboBox* widget, float globalValue) + static float getFloatValue(const NoScrollQComboBox* widget) { return static_cast(widget->currentIndex()); } + static void setFloatValue(NoScrollQComboBox* widget, float value) { widget->setCurrentIndex(static_cast(value)); } + static void makeNullableFloat(NoScrollQComboBox* widget, float globalValue) { widget->insertItem(0, qApp->translate("SettingsDialog", "Use Global Setting [%1]") .arg((globalValue >= 0.0f && static_cast(globalValue) < widget->count()) ? widget->itemText(static_cast(globalValue)) : QString())); } - static std::optional getNullableFloatValue(const QComboBox* widget) + static std::optional getNullableFloatValue(const NoScrollQComboBox* widget) { return isNullValue(widget) ? std::nullopt : std::optional(static_cast(widget->currentIndex() + 1)); } - static void setNullableFloatValue(QComboBox* widget, std::optional value) + static void setNullableFloatValue(NoScrollQComboBox* widget, std::optional value) { widget->setCurrentIndex(value.has_value() ? static_cast(value.value() + 1.0f) : 0); } - static QString getStringValue(const QComboBox* widget) + static QString getStringValue(const NoScrollQComboBox* widget) { const QVariant currentData(widget->currentData()); if (currentData.metaType().id() == QMetaType::QString) @@ -173,7 +173,7 @@ namespace SettingWidgetBinder return widget->currentText(); } - static void setStringValue(QComboBox* widget, const QString& value) + static void setStringValue(NoScrollQComboBox* widget, const QString& value) { const int index = widget->findData(value); if (index >= 0) @@ -184,23 +184,23 @@ namespace SettingWidgetBinder widget->setCurrentText(value); } - static void makeNullableString(QComboBox* widget, const QString& globalValue) + static void makeNullableString(NoScrollQComboBox* widget, const QString& globalValue) { makeNullableInt(widget, widget->findData(globalValue)); } - static std::optional getNullableStringValue(const QComboBox* widget) + static std::optional getNullableStringValue(const NoScrollQComboBox* widget) { return isNullValue(widget) ? std::nullopt : std::optional(getStringValue(widget)); } - static void setNullableStringValue(QComboBox* widget, std::optional value) + static void setNullableStringValue(NoScrollQComboBox* widget, std::optional value) { value.has_value() ? setStringValue(widget, value.value()) : widget->setCurrentIndex(0); } template - static void connectValueChanged(QComboBox* widget, F func) + static void connectValueChanged(NoScrollQComboBox* widget, F func) { - widget->connect(widget, static_cast(&QComboBox::currentIndexChanged), func); + widget->connect(widget, static_cast(&NoScrollQComboBox::currentIndexChanged), func); } }; @@ -302,93 +302,93 @@ namespace SettingWidgetBinder }; template <> - struct SettingAccessor + struct SettingAccessor { - static bool isNullable(const QSpinBox* widget) { return widget->property(NULLABLE_PROPERTY).toBool(); } + static bool isNullable(const NoScrollQSpinBox* widget) { return widget->property(NULLABLE_PROPERTY).toBool(); } - static void updateNullState(QSpinBox* widget, bool isNull) + static void updateNullState(NoScrollQSpinBox* widget, bool isNull) { widget->setPrefix(isNull ? qApp->translate("SettingWidgetBinder", "Default: ") : QString()); } - static bool getBoolValue(const QSpinBox* widget) { return widget->value() > 0; } - static void setBoolValue(QSpinBox* widget, bool value) { widget->setValue(value ? 1 : 0); } - static void makeNullableBool(QSpinBox* widget, bool globalSetting) + static bool getBoolValue(const NoScrollQSpinBox* widget) { return widget->value() > 0; } + static void setBoolValue(NoScrollQSpinBox* widget, bool value) { widget->setValue(value ? 1 : 0); } + static void makeNullableBool(NoScrollQSpinBox* widget, bool globalSetting) { widget->setProperty(NULLABLE_PROPERTY, QVariant(true)); widget->setProperty(GLOBAL_VALUE_PROPERTY, QVariant(globalSetting)); } - static std::optional getNullableBoolValue(const QSpinBox* widget) + static std::optional getNullableBoolValue(const NoScrollQSpinBox* widget) { if (widget->property(IS_NULL_PROPERTY).toBool()) return std::nullopt; return getBoolValue(widget); } - static void setNullableBoolValue(QSpinBox* widget, std::optional value) + static void setNullableBoolValue(NoScrollQSpinBox* widget, std::optional value) { widget->setProperty(IS_NULL_PROPERTY, QVariant(!value.has_value())); setBoolValue(widget, value.has_value() ? value.value() : widget->property(GLOBAL_VALUE_PROPERTY).toBool()); updateNullState(widget, !value.has_value()); } - static int getIntValue(const QSpinBox* widget) { return widget->value(); } - static void setIntValue(QSpinBox* widget, int value) { widget->setValue(value); } - static void makeNullableInt(QSpinBox* widget, int globalValue) + static int getIntValue(const NoScrollQSpinBox* widget) { return widget->value(); } + static void setIntValue(NoScrollQSpinBox* widget, int value) { widget->setValue(value); } + static void makeNullableInt(NoScrollQSpinBox* widget, int globalValue) { widget->setProperty(NULLABLE_PROPERTY, QVariant(true)); widget->setProperty(GLOBAL_VALUE_PROPERTY, QVariant(globalValue)); } - static std::optional getNullableIntValue(const QSpinBox* widget) + static std::optional getNullableIntValue(const NoScrollQSpinBox* widget) { if (widget->property(IS_NULL_PROPERTY).toBool()) return std::nullopt; return getIntValue(widget); } - static void setNullableIntValue(QSpinBox* widget, std::optional value) + static void setNullableIntValue(NoScrollQSpinBox* widget, std::optional value) { widget->setProperty(IS_NULL_PROPERTY, QVariant(!value.has_value())); setIntValue(widget, value.has_value() ? value.value() : widget->property(GLOBAL_VALUE_PROPERTY).toInt()); updateNullState(widget, !value.has_value()); } - static float getFloatValue(const QSpinBox* widget) { return static_cast(widget->value()); } - static void setFloatValue(QSpinBox* widget, float value) { widget->setValue(static_cast(value)); } - static void makeNullableFloat(QSpinBox* widget, float globalValue) + static float getFloatValue(const NoScrollQSpinBox* widget) { return static_cast(widget->value()); } + static void setFloatValue(NoScrollQSpinBox* widget, float value) { widget->setValue(static_cast(value)); } + static void makeNullableFloat(NoScrollQSpinBox* widget, float globalValue) { widget->setProperty(NULLABLE_PROPERTY, QVariant(true)); widget->setProperty(GLOBAL_VALUE_PROPERTY, QVariant(globalValue)); } - static std::optional getNullableFloatValue(const QSpinBox* widget) + static std::optional getNullableFloatValue(const NoScrollQSpinBox* widget) { if (widget->property(IS_NULL_PROPERTY).toBool()) return std::nullopt; return getFloatValue(widget); } - static void setNullableFloatValue(QSpinBox* widget, std::optional value) + static void setNullableFloatValue(NoScrollQSpinBox* widget, std::optional value) { widget->setProperty(IS_NULL_PROPERTY, QVariant(!value.has_value())); setFloatValue(widget, value.has_value() ? value.value() : widget->property(GLOBAL_VALUE_PROPERTY).toFloat()); updateNullState(widget, !value.has_value()); } - static QString getStringValue(const QSpinBox* widget) { return QString::number(widget->value()); } - static void setStringValue(QSpinBox* widget, const QString& value) { widget->setValue(value.toInt()); } - static void makeNullableString(QSpinBox* widget, const QString& globalValue) + static QString getStringValue(const NoScrollQSpinBox* widget) { return QString::number(widget->value()); } + static void setStringValue(NoScrollQSpinBox* widget, const QString& value) { widget->setValue(value.toInt()); } + static void makeNullableString(NoScrollQSpinBox* widget, const QString& globalValue) { widget->setProperty(NULLABLE_PROPERTY, QVariant(true)); widget->setProperty(GLOBAL_VALUE_PROPERTY, QVariant(globalValue)); } - static std::optional getNullableStringValue(const QSpinBox* widget) + static std::optional getNullableStringValue(const NoScrollQSpinBox* widget) { if (widget->property(IS_NULL_PROPERTY).toBool()) return std::nullopt; return getStringValue(widget); } - static void setNullableStringValue(QSpinBox* widget, std::optional value) + static void setNullableStringValue(NoScrollQSpinBox* widget, std::optional value) { widget->setProperty(IS_NULL_PROPERTY, QVariant(!value.has_value())); setStringValue(widget, value.has_value() ? value.value() : widget->property(GLOBAL_VALUE_PROPERTY).toString()); @@ -396,16 +396,16 @@ namespace SettingWidgetBinder } template - static void connectValueChanged(QSpinBox* widget, F func) + static void connectValueChanged(NoScrollQSpinBox* widget, F func) { if (!isNullable(widget)) { - widget->connect(widget, QOverload::of(&QSpinBox::valueChanged), func); + widget->connect(widget, QOverload::of(&NoScrollQSpinBox::valueChanged), func); } else { widget->setContextMenuPolicy(Qt::CustomContextMenu); - widget->connect(widget, &QSpinBox::customContextMenuRequested, widget, [widget, func](const QPoint& pt) { + widget->connect(widget, &NoScrollQSpinBox::customContextMenuRequested, widget, [widget, func](const QPoint& pt) { QMenu menu(widget); widget->connect(menu.addAction(qApp->translate("SettingWidgetBinder", "Reset")), &QAction::triggered, widget, [widget, func = std::move(func)]() { @@ -417,7 +417,7 @@ namespace SettingWidgetBinder }); menu.exec(widget->mapToGlobal(pt)); }); - widget->connect(widget, &QSpinBox::valueChanged, widget, [widget, func = std::move(func)]() { + widget->connect(widget, &NoScrollQSpinBox::valueChanged, widget, [widget, func = std::move(func)]() { if (widget->property(IS_NULL_PROPERTY).toBool()) { widget->setProperty(IS_NULL_PROPERTY, QVariant(false)); @@ -430,93 +430,93 @@ namespace SettingWidgetBinder }; template <> - struct SettingAccessor + struct SettingAccessor { - static bool isNullable(const QDoubleSpinBox* widget) { return widget->property(NULLABLE_PROPERTY).toBool(); } + static bool isNullable(const NoScrollQDoubleSpinBox* widget) { return widget->property(NULLABLE_PROPERTY).toBool(); } - static void updateNullState(QDoubleSpinBox* widget, bool isNull) + static void updateNullState(NoScrollQDoubleSpinBox* widget, bool isNull) { widget->setPrefix(isNull ? qApp->translate("SettingWidgetBinder", "Default: ") : QString()); } - static bool getBoolValue(const QDoubleSpinBox* widget) { return widget->value() > 0.0; } - static void setBoolValue(QDoubleSpinBox* widget, bool value) { widget->setValue(value ? 1.0 : 0.0); } - static void makeNullableBool(QDoubleSpinBox* widget, bool globalSetting) + static bool getBoolValue(const NoScrollQDoubleSpinBox* widget) { return widget->value() > 0.0; } + static void setBoolValue(NoScrollQDoubleSpinBox* widget, bool value) { widget->setValue(value ? 1.0 : 0.0); } + static void makeNullableBool(NoScrollQDoubleSpinBox* widget, bool globalSetting) { widget->setProperty(NULLABLE_PROPERTY, QVariant(true)); widget->setProperty(GLOBAL_VALUE_PROPERTY, QVariant(globalSetting)); } - static std::optional getNullableBoolValue(const QDoubleSpinBox* widget) + static std::optional getNullableBoolValue(const NoScrollQDoubleSpinBox* widget) { if (widget->property(IS_NULL_PROPERTY).toBool()) return std::nullopt; return getBoolValue(widget); } - static void setNullableBoolValue(QDoubleSpinBox* widget, std::optional value) + static void setNullableBoolValue(NoScrollQDoubleSpinBox* widget, std::optional value) { widget->setProperty(IS_NULL_PROPERTY, QVariant(!value.has_value())); setBoolValue(widget, value.has_value() ? value.value() : widget->property(GLOBAL_VALUE_PROPERTY).toBool()); updateNullState(widget, !value.has_value()); } - static int getIntValue(const QDoubleSpinBox* widget) { return static_cast(widget->value()); } - static void setIntValue(QDoubleSpinBox* widget, int value) { widget->setValue(static_cast(value)); } - static void makeNullableInt(QDoubleSpinBox* widget, int globalValue) + static int getIntValue(const NoScrollQDoubleSpinBox* widget) { return static_cast(widget->value()); } + static void setIntValue(NoScrollQDoubleSpinBox* widget, int value) { widget->setValue(static_cast(value)); } + static void makeNullableInt(NoScrollQDoubleSpinBox* widget, int globalValue) { widget->setProperty(NULLABLE_PROPERTY, QVariant(true)); widget->setProperty(GLOBAL_VALUE_PROPERTY, QVariant(globalValue)); } - static std::optional getNullableIntValue(const QDoubleSpinBox* widget) + static std::optional getNullableIntValue(const NoScrollQDoubleSpinBox* widget) { if (widget->property(IS_NULL_PROPERTY).toBool()) return std::nullopt; return getIntValue(widget); } - static void setNullableIntValue(QDoubleSpinBox* widget, std::optional value) + static void setNullableIntValue(NoScrollQDoubleSpinBox* widget, std::optional value) { widget->setProperty(IS_NULL_PROPERTY, QVariant(!value.has_value())); setIntValue(widget, value.has_value() ? value.value() : widget->property(GLOBAL_VALUE_PROPERTY).toInt()); updateNullState(widget, !value.has_value()); } - static float getFloatValue(const QDoubleSpinBox* widget) { return static_cast(widget->value()); } - static void setFloatValue(QDoubleSpinBox* widget, float value) { widget->setValue(static_cast(value)); } - static void makeNullableFloat(QDoubleSpinBox* widget, float globalValue) + static float getFloatValue(const NoScrollQDoubleSpinBox* widget) { return static_cast(widget->value()); } + static void setFloatValue(NoScrollQDoubleSpinBox* widget, float value) { widget->setValue(static_cast(value)); } + static void makeNullableFloat(NoScrollQDoubleSpinBox* widget, float globalValue) { widget->setProperty(NULLABLE_PROPERTY, QVariant(true)); widget->setProperty(GLOBAL_VALUE_PROPERTY, QVariant(globalValue)); } - static std::optional getNullableFloatValue(const QDoubleSpinBox* widget) + static std::optional getNullableFloatValue(const NoScrollQDoubleSpinBox* widget) { if (widget->property(IS_NULL_PROPERTY).toBool()) return std::nullopt; return getFloatValue(widget); } - static void setNullableFloatValue(QDoubleSpinBox* widget, std::optional value) + static void setNullableFloatValue(NoScrollQDoubleSpinBox* widget, std::optional value) { widget->setProperty(IS_NULL_PROPERTY, QVariant(!value.has_value())); setFloatValue(widget, value.has_value() ? value.value() : widget->property(GLOBAL_VALUE_PROPERTY).toFloat()); updateNullState(widget, !value.has_value()); } - static QString getStringValue(const QDoubleSpinBox* widget) { return QString::number(widget->value()); } - static void setStringValue(QDoubleSpinBox* widget, const QString& value) { widget->setValue(value.toDouble()); } - static void makeNullableString(QDoubleSpinBox* widget, const QString& globalValue) + static QString getStringValue(const NoScrollQDoubleSpinBox* widget) { return QString::number(widget->value()); } + static void setStringValue(NoScrollQDoubleSpinBox* widget, const QString& value) { widget->setValue(value.toDouble()); } + static void makeNullableString(NoScrollQDoubleSpinBox* widget, const QString& globalValue) { widget->setProperty(NULLABLE_PROPERTY, QVariant(true)); widget->setProperty(GLOBAL_VALUE_PROPERTY, QVariant(globalValue)); } - static std::optional getNullableStringValue(const QDoubleSpinBox* widget) + static std::optional getNullableStringValue(const NoScrollQDoubleSpinBox* widget) { if (widget->property(IS_NULL_PROPERTY).toBool()) return std::nullopt; return getStringValue(widget); } - static void setNullableStringValue(QDoubleSpinBox* widget, std::optional value) + static void setNullableStringValue(NoScrollQDoubleSpinBox* widget, std::optional value) { widget->setProperty(IS_NULL_PROPERTY, QVariant(!value.has_value())); setStringValue(widget, value.has_value() ? value.value() : widget->property(GLOBAL_VALUE_PROPERTY).toString()); @@ -524,16 +524,16 @@ namespace SettingWidgetBinder } template - static void connectValueChanged(QDoubleSpinBox* widget, F func) + static void connectValueChanged(NoScrollQDoubleSpinBox* widget, F func) { if (!isNullable(widget)) { - widget->connect(widget, QOverload::of(&QDoubleSpinBox::valueChanged), func); + widget->connect(widget, QOverload::of(&NoScrollQDoubleSpinBox::valueChanged), func); } else { widget->setContextMenuPolicy(Qt::CustomContextMenu); - widget->connect(widget, &QDoubleSpinBox::customContextMenuRequested, widget, [widget, func](const QPoint& pt) { + widget->connect(widget, &NoScrollQDoubleSpinBox::customContextMenuRequested, widget, [widget, func](const QPoint& pt) { QMenu menu(widget); widget->connect(menu.addAction(qApp->translate("SettingWidgetBinder", "Reset")), &QAction::triggered, widget, [widget, func = std::move(func)]() { @@ -545,7 +545,7 @@ namespace SettingWidgetBinder }); menu.exec(widget->mapToGlobal(pt)); }); - widget->connect(widget, QOverload::of(&QDoubleSpinBox::valueChanged), widget, [widget, func = std::move(func)]() { + widget->connect(widget, QOverload::of(&NoScrollQDoubleSpinBox::valueChanged), widget, [widget, func = std::move(func)]() { if (widget->property(IS_NULL_PROPERTY).toBool()) { widget->setProperty(IS_NULL_PROPERTY, QVariant(false)); @@ -1096,7 +1096,7 @@ namespace SettingWidgetBinder label->setFont(bold_font); slider->setContextMenuPolicy(Qt::CustomContextMenu); - slider->connect(slider, &QSpinBox::customContextMenuRequested, slider, + slider->connect(slider, &NoScrollQSpinBox::customContextMenuRequested, slider, [sif, slider, label, label_suffix, orig_font = std::move(orig_font), section, key, default_value](const QPoint& pt) { QMenu menu(slider); slider->connect(menu.addAction(qApp->translate("SettingWidgetBinder", "Reset")), &QAction::triggered, slider, diff --git a/pcsx2-qt/Settings/AdvancedSettingsWidget.cpp b/pcsx2-qt/Settings/AdvancedSettingsWidget.cpp index 1d676a363777c3..11b8c9f7d67e53 100644 --- a/pcsx2-qt/Settings/AdvancedSettingsWidget.cpp +++ b/pcsx2-qt/Settings/AdvancedSettingsWidget.cpp @@ -55,9 +55,9 @@ AdvancedSettingsWidget::AdvancedSettingsWidget(SettingsDialog* dialog, QWidget* m_ui.eeClampMode->setCurrentIndex(getClampingModeIndex(-1)); m_ui.vu0ClampMode->setCurrentIndex(getClampingModeIndex(0)); m_ui.vu1ClampMode->setCurrentIndex(getClampingModeIndex(1)); - connect(m_ui.eeClampMode, QOverload::of(&QComboBox::currentIndexChanged), [this](int index) { setClampingMode(-1, index); }); - connect(m_ui.vu0ClampMode, QOverload::of(&QComboBox::currentIndexChanged), [this](int index) { setClampingMode(0, index); }); - connect(m_ui.vu1ClampMode, QOverload::of(&QComboBox::currentIndexChanged), [this](int index) { setClampingMode(1, index); }); + connect(m_ui.eeClampMode, QOverload::of(&NoScrollQComboBox::currentIndexChanged), [this](int index) { setClampingMode(-1, index); }); + connect(m_ui.vu0ClampMode, QOverload::of(&NoScrollQComboBox::currentIndexChanged), [this](int index) { setClampingMode(0, index); }); + connect(m_ui.vu1ClampMode, QOverload::of(&NoScrollQComboBox::currentIndexChanged), [this](int index) { setClampingMode(1, index); }); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.iopRecompiler, "EmuCore/CPU/Recompiler", "EnableIOP", true); diff --git a/pcsx2-qt/Settings/AdvancedSettingsWidget.ui b/pcsx2-qt/Settings/AdvancedSettingsWidget.ui index 67717592fb3d25..2c81a58678fdf7 100644 --- a/pcsx2-qt/Settings/AdvancedSettingsWidget.ui +++ b/pcsx2-qt/Settings/AdvancedSettingsWidget.ui @@ -74,7 +74,7 @@
- + Nearest @@ -105,7 +105,7 @@ - + None @@ -191,7 +191,7 @@ - + Nearest @@ -240,7 +240,7 @@ - + None @@ -285,7 +285,7 @@ - + Nearest @@ -309,7 +309,7 @@ - + None @@ -381,7 +381,7 @@ - + hz @@ -391,7 +391,7 @@ - + hz @@ -475,6 +475,18 @@ + + + NoScrollQComboBox + QComboBox +
NoScrollQComboBox.h
+
+ + NoScrollQDoubleSpinBox + QComboBox +
NoScrollQDoubleSpinBox.h
+
+
diff --git a/pcsx2-qt/Settings/AudioSettingsWidget.cpp b/pcsx2-qt/Settings/AudioSettingsWidget.cpp index f567c20eecf1c4..1f7640b124bad4 100644 --- a/pcsx2-qt/Settings/AudioSettingsWidget.cpp +++ b/pcsx2-qt/Settings/AudioSettingsWidget.cpp @@ -51,8 +51,8 @@ AudioSettingsWidget::AudioSettingsWidget(SettingsDialog* dialog, QWidget* parent SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.syncMode, "SPU2/Output", "SynchMode", DEFAULT_SYNCHRONIZATION_MODE); SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.expansionMode, "SPU2/Output", "SpeakerConfiguration", DEFAULT_EXPANSION_MODE); SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.dplLevel, "SPU2/Output", "DplDecodingLevel", DEFAULT_DPL_DECODING_LEVEL); - connect(m_ui.syncMode, QOverload::of(&QComboBox::currentIndexChanged), this, &AudioSettingsWidget::updateTargetLatencyRange); - connect(m_ui.expansionMode, QOverload::of(&QComboBox::currentIndexChanged), this, &AudioSettingsWidget::expansionModeChanged); + connect(m_ui.syncMode, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, &AudioSettingsWidget::updateTargetLatencyRange); + connect(m_ui.expansionMode, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, &AudioSettingsWidget::expansionModeChanged); updateTargetLatencyRange(); expansionModeChanged(); @@ -63,8 +63,8 @@ AudioSettingsWidget::AudioSettingsWidget(SettingsDialog* dialog, QWidget* parent SettingWidgetBinder::BindSliderToIntSetting( sif, m_ui.outputLatency, m_ui.outputLatencyLabel, tr(" ms"), "SPU2/Output", "OutputLatency", DEFAULT_OUTPUT_LATENCY); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.outputLatencyMinimal, "SPU2/Output", "OutputLatencyMinimal", false); - connect(m_ui.outputModule, &QComboBox::currentIndexChanged, this, &AudioSettingsWidget::outputModuleChanged); - connect(m_ui.backend, &QComboBox::currentIndexChanged, this, &AudioSettingsWidget::outputBackendChanged); + connect(m_ui.outputModule, &NoScrollQComboBox::currentIndexChanged, this, &AudioSettingsWidget::outputModuleChanged); + connect(m_ui.backend, &NoScrollQComboBox::currentIndexChanged, this, &AudioSettingsWidget::outputBackendChanged); connect(m_ui.targetLatency, &QSlider::valueChanged, this, &AudioSettingsWidget::updateLatencyLabels); connect(m_ui.outputLatency, &QSlider::valueChanged, this, &AudioSettingsWidget::updateLatencyLabels); connect(m_ui.outputLatencyMinimal, &QCheckBox::stateChanged, this, &AudioSettingsWidget::updateLatencyLabels); diff --git a/pcsx2-qt/Settings/AudioSettingsWidget.ui b/pcsx2-qt/Settings/AudioSettingsWidget.ui index 6e6be4588820d3..de82be3416f422 100644 --- a/pcsx2-qt/Settings/AudioSettingsWidget.ui +++ b/pcsx2-qt/Settings/AudioSettingsWidget.ui @@ -285,7 +285,7 @@
- + TimeStretch (Recommended) @@ -311,7 +311,7 @@ - + Stereo (None, Default) @@ -342,7 +342,7 @@ - + None (Default) @@ -417,7 +417,7 @@ - + @@ -474,7 +474,7 @@ - + @@ -494,13 +494,20 @@ - +
+ + + NoScrollQComboBox + QComboBox +
NoScrollQComboBox.h
+
+
diff --git a/pcsx2-qt/Settings/ControllerBindingWidget.ui b/pcsx2-qt/Settings/ControllerBindingWidget.ui index b4884ec06b3ac2..c81a1938362acb 100644 --- a/pcsx2-qt/Settings/ControllerBindingWidget.ui +++ b/pcsx2-qt/Settings/ControllerBindingWidget.ui @@ -35,7 +35,7 @@ - + @@ -152,6 +152,13 @@
+ + + NoScrollQComboBox + QComboBox +
NoScrollQComboBox.h
+
+
diff --git a/pcsx2-qt/Settings/ControllerBindingWidgets.cpp b/pcsx2-qt/Settings/ControllerBindingWidgets.cpp index 36a00c9c6cb36d..6ef31f0ac6c93a 100644 --- a/pcsx2-qt/Settings/ControllerBindingWidgets.cpp +++ b/pcsx2-qt/Settings/ControllerBindingWidgets.cpp @@ -54,7 +54,7 @@ ControllerBindingWidget::ControllerBindingWidget(QWidget* parent, ControllerSett ControllerSettingWidgetBinder::BindWidgetToInputProfileString( m_dialog->getProfileSettingsInterface(), m_ui.controllerType, m_config_section, "Type", PAD::GetDefaultPadType(port)); - connect(m_ui.controllerType, QOverload::of(&QComboBox::currentIndexChanged), this, &ControllerBindingWidget::onTypeChanged); + connect(m_ui.controllerType, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, &ControllerBindingWidget::onTypeChanged); connect(m_ui.bindings, &QPushButton::clicked, this, &ControllerBindingWidget::onBindingsClicked); connect(m_ui.settings, &QPushButton::clicked, this, &ControllerBindingWidget::onSettingsClicked); connect(m_ui.macros, &QPushButton::clicked, this, &ControllerBindingWidget::onMacrosClicked); @@ -565,7 +565,7 @@ void ControllerCustomSettingsWidget::createSettingWidgets(const char* translatio case SettingInfo::Type::Integer: { - QSpinBox* sb = new QSpinBox(widget_parent); + NoScrollQSpinBox* sb = new NoScrollQSpinBox(widget_parent); sb->setObjectName(QString::fromUtf8(si.name)); sb->setMinimum(si.IntegerMinValue()); sb->setMaximum(si.IntegerMaxValue()); @@ -586,7 +586,7 @@ void ControllerCustomSettingsWidget::createSettingWidgets(const char* translatio case SettingInfo::Type::IntegerList: { - QComboBox* cb = new QComboBox(widget_parent); + NoScrollQComboBox* cb = new NoScrollQComboBox(widget_parent); cb->setObjectName(QString::fromUtf8(si.name)); for (u32 i = 0; si.options[i] != nullptr; i++) cb->addItem(qApp->translate(translation_ctx, si.options[i])); @@ -600,7 +600,7 @@ void ControllerCustomSettingsWidget::createSettingWidgets(const char* translatio case SettingInfo::Type::Float: { - QDoubleSpinBox* sb = new QDoubleSpinBox(widget_parent); + NoScrollQDoubleSpinBox* sb = new NoScrollQDoubleSpinBox(widget_parent); sb->setObjectName(QString::fromUtf8(si.name)); sb->setMinimum(si.FloatMinValue() * si.multiplier); sb->setMaximum(si.FloatMaxValue() * si.multiplier); @@ -637,7 +637,7 @@ void ControllerCustomSettingsWidget::createSettingWidgets(const char* translatio case SettingInfo::Type::StringList: { - QComboBox* cb = new QComboBox(widget_parent); + NoScrollQComboBox* cb = new NoScrollQComboBox(widget_parent); cb->setObjectName(QString::fromUtf8(si.name)); if (si.get_options) { @@ -718,7 +718,7 @@ void ControllerCustomSettingsWidget::restoreDefaults() case SettingInfo::Type::Integer: { - QSpinBox* widget = findChild(QString::fromStdString(si.name)); + NoScrollQSpinBox* widget = findChild(QString::fromStdString(si.name)); if (widget) widget->setValue(si.IntegerDefaultValue()); } @@ -726,7 +726,7 @@ void ControllerCustomSettingsWidget::restoreDefaults() case SettingInfo::Type::IntegerList: { - QComboBox* widget = findChild(QString::fromStdString(si.name)); + NoScrollQComboBox* widget = findChild(QString::fromStdString(si.name)); if (widget) widget->setCurrentIndex(si.IntegerDefaultValue() - si.IntegerMinValue()); } @@ -734,7 +734,7 @@ void ControllerCustomSettingsWidget::restoreDefaults() case SettingInfo::Type::Float: { - QDoubleSpinBox* widget = findChild(QString::fromStdString(si.name)); + NoScrollQDoubleSpinBox* widget = findChild(QString::fromStdString(si.name)); if (widget) widget->setValue(si.FloatDefaultValue() * si.multiplier); } @@ -750,7 +750,7 @@ void ControllerCustomSettingsWidget::restoreDefaults() case SettingInfo::Type::StringList: { - QComboBox* widget = findChild(QString::fromStdString(si.name)); + NoScrollQComboBox* widget = findChild(QString::fromStdString(si.name)); if (widget) { const QString default_value(QString::fromUtf8(si.StringDefaultValue())); @@ -884,8 +884,8 @@ USBDeviceWidget::USBDeviceWidget(QWidget* parent, ControllerSettingsDialog* dial ControllerSettingWidgetBinder::BindWidgetToInputProfileString( m_dialog->getProfileSettingsInterface(), m_ui.deviceType, m_config_section, "Type", "None"); - connect(m_ui.deviceType, QOverload::of(&QComboBox::currentIndexChanged), this, &USBDeviceWidget::onTypeChanged); - connect(m_ui.deviceSubtype, QOverload::of(&QComboBox::currentIndexChanged), this, &USBDeviceWidget::onSubTypeChanged); + connect(m_ui.deviceType, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, &USBDeviceWidget::onTypeChanged); + connect(m_ui.deviceSubtype, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, &USBDeviceWidget::onSubTypeChanged); connect(m_ui.bindings, &QPushButton::clicked, this, &USBDeviceWidget::onBindingsClicked); connect(m_ui.settings, &QPushButton::clicked, this, &USBDeviceWidget::onSettingsClicked); connect(m_ui.automaticBinding, &QPushButton::clicked, this, &USBDeviceWidget::onAutomaticBindingClicked); diff --git a/pcsx2-qt/Settings/ControllerSettingWidgetBinder.h b/pcsx2-qt/Settings/ControllerSettingWidgetBinder.h index ee502685e654c6..28b2a4b241fd1c 100644 --- a/pcsx2-qt/Settings/ControllerSettingWidgetBinder.h +++ b/pcsx2-qt/Settings/ControllerSettingWidgetBinder.h @@ -26,11 +26,11 @@ #include #include #include -#include -#include +#include "CustomQtWidgets/NoScrollQComboBox.h" +#include "CustomQtWidgets/NoScrollQDoubleSpinBox.h" #include #include -#include +#include "CustomQtWidgets/NoScrollQSpinBox.h" /// This nastyness is required because input profiles aren't overlaid settings like the rest of them, it's /// input profile *or* global, not both. diff --git a/pcsx2-qt/Settings/ControllerSettingsDialog.cpp b/pcsx2-qt/Settings/ControllerSettingsDialog.cpp index 3fefc5b356f954..52e7e30bf3b8fe 100644 --- a/pcsx2-qt/Settings/ControllerSettingsDialog.cpp +++ b/pcsx2-qt/Settings/ControllerSettingsDialog.cpp @@ -48,7 +48,7 @@ ControllerSettingsDialog::ControllerSettingsDialog(QWidget* parent /* = nullptr m_ui.settingsCategory->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); connect(m_ui.settingsCategory, &QListWidget::currentRowChanged, this, &ControllerSettingsDialog::onCategoryCurrentRowChanged); - connect(m_ui.currentProfile, &QComboBox::currentIndexChanged, this, &ControllerSettingsDialog::onCurrentProfileChanged); + connect(m_ui.currentProfile, &NoScrollQComboBox::currentIndexChanged, this, &ControllerSettingsDialog::onCurrentProfileChanged); connect(m_ui.buttonBox, &QDialogButtonBox::rejected, this, &ControllerSettingsDialog::close); connect(m_ui.newProfile, &QPushButton::clicked, this, &ControllerSettingsDialog::onNewProfileClicked); connect(m_ui.loadProfile, &QPushButton::clicked, this, &ControllerSettingsDialog::onLoadProfileClicked); diff --git a/pcsx2-qt/Settings/ControllerSettingsDialog.ui b/pcsx2-qt/Settings/ControllerSettingsDialog.ui index cebf55c8f299da..8438636519f8f1 100644 --- a/pcsx2-qt/Settings/ControllerSettingsDialog.ui +++ b/pcsx2-qt/Settings/ControllerSettingsDialog.ui @@ -73,7 +73,7 @@
- + 0 @@ -145,6 +145,13 @@ + + + NoScrollQComboBox + QComboBox +
NoScrollQComboBox.h
+
+
diff --git a/pcsx2-qt/Settings/DEV9SettingsWidget.cpp b/pcsx2-qt/Settings/DEV9SettingsWidget.cpp index 09290128eae10e..43ea65c86633d2 100644 --- a/pcsx2-qt/Settings/DEV9SettingsWidget.cpp +++ b/pcsx2-qt/Settings/DEV9SettingsWidget.cpp @@ -78,7 +78,7 @@ DEV9SettingsWidget::DEV9SettingsWidget(SettingsDialog* dialog, QWidget* parent) ////////////////////////////////////////////////////////////////////////// // Eth Device Settings ////////////////////////////////////////////////////////////////////////// - connect(m_ui.ethDevType, QOverload::of(&QComboBox::currentIndexChanged), this, &DEV9SettingsWidget::onEthDeviceTypeChanged); + connect(m_ui.ethDevType, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, &DEV9SettingsWidget::onEthDeviceTypeChanged); m_api_list.push_back(Pcsx2Config::DEV9Options::NetApi::Unset); @@ -153,7 +153,7 @@ DEV9SettingsWidget::DEV9SettingsWidget(SettingsDialog* dialog, QWidget* parent) } //onEthDeviceTypeChanged gets called automatically - connect(m_ui.ethDev, QOverload::of(&QComboBox::currentIndexChanged), this, &DEV9SettingsWidget::onEthDeviceChanged); + connect(m_ui.ethDev, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, &DEV9SettingsWidget::onEthDeviceChanged); ////////////////////////////////////////////////////////////////////////// // DHCP Settings @@ -214,12 +214,12 @@ DEV9SettingsWidget::DEV9SettingsWidget(SettingsDialog* dialog, QWidget* parent) SettingWidgetBinder::BindWidgetToEnumSetting(sif, m_ui.ethDNS1Mode, "DEV9/Eth", "ModeDNS1", s_dns_name, Pcsx2Config::DEV9Options::DnsModeNames, Pcsx2Config::DEV9Options::DnsModeNames[static_cast(Pcsx2Config::DEV9Options::DnsMode::Auto)], "DEV9SettingsWidget"); onEthDNSModeChanged(m_ui.ethDNS1Mode, m_ui.ethDNS1Mode->currentIndex(), m_ui.ethDNS1Addr, "DEV9/Eth", "ModeDNS1"); - connect(m_ui.ethDNS1Mode, QOverload::of(&QComboBox::currentIndexChanged), this, [&](int index) { onEthDNSModeChanged(m_ui.ethDNS1Mode, index, m_ui.ethDNS1Addr, "DEV9/Eth", "ModeDNS1"); }); + connect(m_ui.ethDNS1Mode, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, [&](int index) { onEthDNSModeChanged(m_ui.ethDNS1Mode, index, m_ui.ethDNS1Addr, "DEV9/Eth", "ModeDNS1"); }); SettingWidgetBinder::BindWidgetToEnumSetting(sif, m_ui.ethDNS2Mode, "DEV9/Eth", "ModeDNS2", s_dns_name, Pcsx2Config::DEV9Options::DnsModeNames, Pcsx2Config::DEV9Options::DnsModeNames[static_cast(Pcsx2Config::DEV9Options::DnsMode::Auto)], "DEV9SettingsWidget"); onEthDNSModeChanged(m_ui.ethDNS2Mode, m_ui.ethDNS2Mode->currentIndex(), m_ui.ethDNS2Addr, "DEV9/Eth", "ModeDNS2"); - connect(m_ui.ethDNS2Mode, QOverload::of(&QComboBox::currentIndexChanged), this, [&](int index) { onEthDNSModeChanged(m_ui.ethDNS2Mode, index, m_ui.ethDNS2Addr, "DEV9/Eth", "ModeDNS2"); }); + connect(m_ui.ethDNS2Mode, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, [&](int index) { onEthDNSModeChanged(m_ui.ethDNS2Mode, index, m_ui.ethDNS2Addr, "DEV9/Eth", "ModeDNS2"); }); ////////////////////////////////////////////////////////////////////////// // DNS Settings @@ -279,8 +279,8 @@ DEV9SettingsWidget::DEV9SettingsWidget(SettingsDialog* dialog, QWidget* parent) sizeOpt = size; const int sizeGlobal = (u64)Host::GetBaseIntSettingValue("DEV9/Hdd", "HddSizeSectors", 0) * 512 / (1024 * 1024 * 1024); - SettingWidgetBinder::SettingAccessor::makeNullableInt(m_ui.hddSizeSpinBox, sizeGlobal); - SettingWidgetBinder::SettingAccessor::setNullableIntValue(m_ui.hddSizeSpinBox, sizeOpt); + SettingWidgetBinder::SettingAccessor::makeNullableInt(m_ui.hddSizeSpinBox, sizeGlobal); + SettingWidgetBinder::SettingAccessor::setNullableIntValue(m_ui.hddSizeSpinBox, sizeOpt); m_ui.hddSizeSlider->setValue(sizeOpt.value_or(sizeGlobal)); @@ -290,11 +290,11 @@ DEV9SettingsWidget::DEV9SettingsWidget(SettingsDialog* dialog, QWidget* parent) else { m_ui.hddSizeSlider->setValue(size); - SettingWidgetBinder::SettingAccessor::setIntValue(m_ui.hddSizeSpinBox, size); + SettingWidgetBinder::SettingAccessor::setIntValue(m_ui.hddSizeSpinBox, size); } connect(m_ui.hddSizeSlider, QOverload::of(&QSlider::valueChanged), this, &DEV9SettingsWidget::onHddSizeSlide); - SettingWidgetBinder::SettingAccessor::connectValueChanged(m_ui.hddSizeSpinBox, [&]() { onHddSizeAccessorSpin(); }); + SettingWidgetBinder::SettingAccessor::connectValueChanged(m_ui.hddSizeSpinBox, [&]() { onHddSizeAccessorSpin(); }); connect(m_ui.hddCreate, &QPushButton::clicked, this, &DEV9SettingsWidget::onHddCreateClicked); } @@ -454,7 +454,7 @@ void DEV9SettingsWidget::onEthAutoChanged(QCheckBox* sender, int state, QLineEdi input->setEnabled(false); } -void DEV9SettingsWidget::onEthDNSModeChanged(QComboBox* sender, int index, QLineEdit* input, const char* section, const char* key) +void DEV9SettingsWidget::onEthDNSModeChanged(NoScrollQComboBox* sender, int index, QLineEdit* input, const char* section, const char* key) { if (sender->isEnabled()) { @@ -760,7 +760,7 @@ void DEV9SettingsWidget::onHddSizeSlide(int i) { // We have to call onHddSizeAccessorSpin() ourself, as the value could still be considered null when the valueChanged signal is fired QSignalBlocker sb(m_ui.hddSizeSpinBox); - SettingWidgetBinder::SettingAccessor::setNullableIntValue(m_ui.hddSizeSpinBox, i); + SettingWidgetBinder::SettingAccessor::setNullableIntValue(m_ui.hddSizeSpinBox, i); onHddSizeAccessorSpin(); } @@ -775,7 +775,7 @@ void DEV9SettingsWidget::onHddSizeSliderReset([[maybe_unused]] bool checked) { // We have to call onHddSizeAccessorSpin() ourself, as the value could still be considered non-null when the valueChanged signal is fired QSignalBlocker sb(m_ui.hddSizeSpinBox); - SettingWidgetBinder::SettingAccessor::setNullableIntValue(m_ui.hddSizeSpinBox, std::nullopt); + SettingWidgetBinder::SettingAccessor::setNullableIntValue(m_ui.hddSizeSpinBox, std::nullopt); onHddSizeAccessorSpin(); } @@ -785,7 +785,7 @@ void DEV9SettingsWidget::onHddSizeAccessorSpin() QSignalBlocker sb(m_ui.hddSizeSlider); if (m_dialog->isPerGameSettings()) { - std::optional new_value = SettingWidgetBinder::SettingAccessor::getNullableIntValue(m_ui.hddSizeSpinBox); + std::optional new_value = SettingWidgetBinder::SettingAccessor::getNullableIntValue(m_ui.hddSizeSpinBox); const int sizeGlobal = (u64)Host::GetBaseIntSettingValue("DEV9/Hdd", "HddSizeSectors", 0) * 512 / (1024 * 1024 * 1024); m_ui.hddSizeSlider->setValue(new_value.value_or(sizeGlobal)); @@ -797,7 +797,7 @@ void DEV9SettingsWidget::onHddSizeAccessorSpin() } else { - const int new_value = SettingWidgetBinder::SettingAccessor::getIntValue(m_ui.hddSizeSpinBox); + const int new_value = SettingWidgetBinder::SettingAccessor::getIntValue(m_ui.hddSizeSpinBox); m_ui.hddSizeSlider->setValue(new_value); m_dialog->setIntSettingValue("DEV9/Hdd", "HddSizeSectors", new_value * (1024 * 1024 * 1024 / 512)); } @@ -857,7 +857,7 @@ void DEV9SettingsWidget::showEvent(QShowEvent* event) const std::string value = m_dialog->getStringValue("DEV9/Eth", "EthApi", Pcsx2Config::DEV9Options::NetApiNames[static_cast(Pcsx2Config::DEV9Options::NetApi::Unset)]).value(); //disconnect temporally to prevent saving a vaule already in the config file - disconnect(m_ui.ethDev, QOverload::of(&QComboBox::currentIndexChanged), this, &DEV9SettingsWidget::onEthDeviceChanged); + disconnect(m_ui.ethDev, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, &DEV9SettingsWidget::onEthDeviceChanged); for (int i = 0; m_api_namelist[i] != nullptr; i++) { if (value == m_api_valuelist[i]) @@ -866,7 +866,7 @@ void DEV9SettingsWidget::showEvent(QShowEvent* event) break; } } - connect(m_ui.ethDev, QOverload::of(&QComboBox::currentIndexChanged), this, &DEV9SettingsWidget::onEthDeviceChanged); + connect(m_ui.ethDev, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, &DEV9SettingsWidget::onEthDeviceChanged); } /* diff --git a/pcsx2-qt/Settings/DEV9SettingsWidget.h b/pcsx2-qt/Settings/DEV9SettingsWidget.h index eff77a08f04959..4b0823ab900158 100644 --- a/pcsx2-qt/Settings/DEV9SettingsWidget.h +++ b/pcsx2-qt/Settings/DEV9SettingsWidget.h @@ -37,7 +37,7 @@ private Q_SLOTS: void onEthDHCPInterceptChanged(int state); void onEthIPChanged(QLineEdit* sender, const char* section, const char* key); void onEthAutoChanged(QCheckBox* sender, int state, QLineEdit* input, const char* section, const char* key); - void onEthDNSModeChanged(QComboBox* sender, int index, QLineEdit* input, const char* section, const char* key); + void onEthDNSModeChanged(NoScrollQComboBox* sender, int index, QLineEdit* input, const char* section, const char* key); void onEthHostAdd(); void onEthHostDel(); void onEthHostExport(); diff --git a/pcsx2-qt/Settings/DEV9SettingsWidget.ui b/pcsx2-qt/Settings/DEV9SettingsWidget.ui index c1a46faea3b703..65c3fce8b4d55e 100644 --- a/pcsx2-qt/Settings/DEV9SettingsWidget.ui +++ b/pcsx2-qt/Settings/DEV9SettingsWidget.ui @@ -33,7 +33,7 @@ - + @@ -63,7 +63,7 @@ - + @@ -167,7 +167,7 @@ - + @@ -256,7 +256,7 @@ - + @@ -325,7 +325,7 @@ - + 40 @@ -386,6 +386,18 @@ + + + NoScrollQComboBox + QComboBox +
NoScrollQComboBox.h
+
+ + NoScrollQSpinBox + QComboBox +
NoScrollQSpinBox.h
+
+
diff --git a/pcsx2-qt/Settings/DebugSettingsWidget.ui b/pcsx2-qt/Settings/DebugSettingsWidget.ui index 0a17f7828ce6a3..872fe50c287f91 100644 --- a/pcsx2-qt/Settings/DebugSettingsWidget.ui +++ b/pcsx2-qt/Settings/DebugSettingsWidget.ui @@ -92,7 +92,7 @@ - + 99999 @@ -106,7 +106,7 @@ - + 1 @@ -193,6 +193,13 @@ + + + NoScrollQSpinBox + QComboBox +
NoScrollQSpinBox.h
+
+
diff --git a/pcsx2-qt/Settings/EmulationSettingsWidget.cpp b/pcsx2-qt/Settings/EmulationSettingsWidget.cpp index 3318ebe210fa42..95201512b1ef25 100644 --- a/pcsx2-qt/Settings/EmulationSettingsWidget.cpp +++ b/pcsx2-qt/Settings/EmulationSettingsWidget.cpp @@ -97,7 +97,7 @@ EmulationSettingsWidget::EmulationSettingsWidget(SettingsDialog* dialog, QWidget m_ui.eeCycleRate->setCurrentIndex(cycle_rate.has_value() ? (std::clamp(cycle_rate.value(), MINIMUM_EE_CYCLE_RATE, MAXIMUM_EE_CYCLE_RATE) + (0 - MINIMUM_EE_CYCLE_RATE) + static_cast(m_dialog->isPerGameSettings())) : 0); - connect(m_ui.eeCycleRate, QOverload::of(&QComboBox::currentIndexChanged), this, [this](int index) { + connect(m_ui.eeCycleRate, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, [this](int index) { std::optional value; if (!m_dialog->isPerGameSettings() || index > 0) value = MINIMUM_EE_CYCLE_RATE + index - static_cast(m_dialog->isPerGameSettings()); @@ -160,7 +160,7 @@ EmulationSettingsWidget::EmulationSettingsWidget(SettingsDialog* dialog, QWidget EmulationSettingsWidget::~EmulationSettingsWidget() = default; -void EmulationSettingsWidget::initializeSpeedCombo(QComboBox* cb, const char* section, const char* key, float default_value) +void EmulationSettingsWidget::initializeSpeedCombo(NoScrollQComboBox* cb, const char* section, const char* key, float default_value) { float value = Host::GetBaseFloatSettingValue(section, key, default_value); if (m_dialog->isPerGameSettings()) @@ -204,11 +204,11 @@ void EmulationSettingsWidget::initializeSpeedCombo(QComboBox* cb, const char* se cb->setCurrentIndex(custom_index); } - connect(cb, QOverload::of(&QComboBox::currentIndexChanged), this, + connect(cb, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, [this, cb, section, key](int index) { handleSpeedComboChange(cb, section, key); }); } -void EmulationSettingsWidget::handleSpeedComboChange(QComboBox* cb, const char* section, const char* key) +void EmulationSettingsWidget::handleSpeedComboChange(NoScrollQComboBox* cb, const char* section, const char* key) { const int custom_index = cb->count() - 1; const int current_index = cb->currentIndex(); diff --git a/pcsx2-qt/Settings/EmulationSettingsWidget.h b/pcsx2-qt/Settings/EmulationSettingsWidget.h index 95dae600ad6e47..b2873504b43c40 100644 --- a/pcsx2-qt/Settings/EmulationSettingsWidget.h +++ b/pcsx2-qt/Settings/EmulationSettingsWidget.h @@ -33,8 +33,8 @@ private Q_SLOTS: void onOptimalFramePacingChanged(); private: - void initializeSpeedCombo(QComboBox* cb, const char* section, const char* key, float default_value); - void handleSpeedComboChange(QComboBox* cb, const char* section, const char* key); + void initializeSpeedCombo(NoScrollQComboBox* cb, const char* section, const char* key, float default_value); + void handleSpeedComboChange(NoScrollQComboBox* cb, const char* section, const char* key); void updateOptimalFramePacing(); SettingsDialog* m_dialog; diff --git a/pcsx2-qt/Settings/EmulationSettingsWidget.ui b/pcsx2-qt/Settings/EmulationSettingsWidget.ui index 513e707485b743..9183ee5a0faa1c 100644 --- a/pcsx2-qt/Settings/EmulationSettingsWidget.ui +++ b/pcsx2-qt/Settings/EmulationSettingsWidget.ui @@ -33,13 +33,13 @@ - + - + - + @@ -125,7 +125,7 @@ - + Disabled @@ -156,7 +156,7 @@ - + 50% (Underclock) @@ -202,7 +202,7 @@ - + Disabled @@ -250,7 +250,7 @@ - + frames @@ -305,6 +305,18 @@ + + + NoScrollQComboBox + QComboBox +
NoScrollQComboBox.h
+
+ + NoScrollQSpinBox + QComboBox +
NoScrollQSpinBox.h
+
+
diff --git a/pcsx2-qt/Settings/GameSummaryWidget.cpp b/pcsx2-qt/Settings/GameSummaryWidget.cpp index b0b8a0ffd2c7a5..cb34b8ade2c05b 100644 --- a/pcsx2-qt/Settings/GameSummaryWidget.cpp +++ b/pcsx2-qt/Settings/GameSummaryWidget.cpp @@ -52,7 +52,7 @@ GameSummaryWidget::GameSummaryWidget(const GameList::Entry* entry, SettingsDialo populateDetails(entry); populateDiscPath(entry); - connect(m_ui.inputProfile, &QComboBox::currentIndexChanged, this, &GameSummaryWidget::onInputProfileChanged); + connect(m_ui.inputProfile, &NoScrollQComboBox::currentIndexChanged, this, &GameSummaryWidget::onInputProfileChanged); } GameSummaryWidget::~GameSummaryWidget() = default; diff --git a/pcsx2-qt/Settings/GameSummaryWidget.ui b/pcsx2-qt/Settings/GameSummaryWidget.ui index 0f23cb6fe8074e..547382d1fff33f 100644 --- a/pcsx2-qt/Settings/GameSummaryWidget.ui +++ b/pcsx2-qt/Settings/GameSummaryWidget.ui @@ -90,7 +90,7 @@
- + false @@ -140,7 +140,7 @@ - + false @@ -308,7 +308,7 @@ - + false @@ -366,7 +366,7 @@ - + 0 @@ -423,6 +423,13 @@
+ + + NoScrollQComboBox + QComboBox +
NoScrollQComboBox.h
+
+
diff --git a/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp b/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp index 183fa28a8dda4d..4c3fe4ea4dd6ad 100644 --- a/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp +++ b/pcsx2-qt/Settings/GraphicsSettingsWidget.cpp @@ -122,7 +122,7 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsDialog* dialog, QWidget* SettingWidgetBinder::BindWidgetToIntSetting(sif, m_ui.cropBottom, "EmuCore/GS", "CropBottom", 0); connect( - m_ui.fullscreenModes, QOverload::of(&QComboBox::currentIndexChanged), this, &GraphicsSettingsWidget::onFullscreenModeChanged); + m_ui.fullscreenModes, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, &GraphicsSettingsWidget::onFullscreenModeChanged); ////////////////////////////////////////////////////////////////////////// // OSD Settings @@ -174,7 +174,7 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsDialog* dialog, QWidget* sif, m_ui.blending, "EmuCore/GS", "accurate_blending_unit", static_cast(AccBlendLevel::Basic)); SettingWidgetBinder::BindWidgetToIntSetting( sif, m_ui.texturePreloading, "EmuCore/GS", "texture_preloading", static_cast(TexturePreloadingLevel::Off)); - connect(m_ui.trilinearFiltering, QOverload::of(&QComboBox::currentIndexChanged), this, + connect(m_ui.trilinearFiltering, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, &GraphicsSettingsWidget::onTrilinearFilteringChanged); onTrilinearFilteringChanged(); @@ -203,10 +203,10 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsDialog* dialog, QWidget* sif, m_ui.targetPartialInvalidation, "EmuCore/GS", "UserHacks_TargetPartialInvalidation", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.estimateTextureRegion, "EmuCore/GS", "UserHacks_EstimateTextureRegion", false); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.gpuPaletteConversion, "EmuCore/GS", "paltex", false); - connect(m_ui.cpuSpriteRenderBW, QOverload::of(&QComboBox::currentIndexChanged), this, + connect(m_ui.cpuSpriteRenderBW, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, &GraphicsSettingsWidget::onCPUSpriteRenderBWChanged); connect( - m_ui.textureInsideRt, QOverload::of(&QComboBox::currentIndexChanged), this, &GraphicsSettingsWidget::onTextureInsideRtChanged); + m_ui.textureInsideRt, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, &GraphicsSettingsWidget::onTextureInsideRtChanged); connect(m_ui.gpuPaletteConversion, QOverload::of(&QCheckBox::stateChanged), this, &GraphicsSettingsWidget::onGpuPaletteConversionChanged); onCPUSpriteRenderBWChanged(); @@ -293,10 +293,10 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsDialog* dialog, QWidget* m_ui.renderer->setCurrentIndex(0); } - connect(m_ui.renderer, QOverload::of(&QComboBox::currentIndexChanged), this, &GraphicsSettingsWidget::onRendererChanged); + connect(m_ui.renderer, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, &GraphicsSettingsWidget::onRendererChanged); connect(m_ui.enableHWFixes, &QCheckBox::stateChanged, this, &GraphicsSettingsWidget::updateRendererDependentOptions); - connect(m_ui.textureFiltering, &QComboBox::currentIndexChanged, this, &GraphicsSettingsWidget::onTextureFilteringChange); - connect(m_ui.swTextureFiltering, &QComboBox::currentIndexChanged, this, &GraphicsSettingsWidget::onSWTextureFilteringChange); + connect(m_ui.textureFiltering, &NoScrollQComboBox::currentIndexChanged, this, &GraphicsSettingsWidget::onTextureFilteringChange); + connect(m_ui.swTextureFiltering, &NoScrollQComboBox::currentIndexChanged, this, &GraphicsSettingsWidget::onSWTextureFilteringChange); updateRendererDependentOptions(); #ifndef _WIN32 @@ -333,7 +333,7 @@ GraphicsSettingsWidget::GraphicsSettingsWidget(SettingsDialog* dialog, QWidget* Path::Combine(EmuFolders::DataRoot, "videos")); SettingWidgetBinder::BindWidgetToStringSetting(sif, m_ui.captureContainer, "EmuCore/GS", "CaptureContainer"); - connect(m_ui.captureContainer, &QComboBox::currentIndexChanged, this, &GraphicsSettingsWidget::onCaptureContainerChanged); + connect(m_ui.captureContainer, &NoScrollQComboBox::currentIndexChanged, this, &GraphicsSettingsWidget::onCaptureContainerChanged); SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.enableVideoCapture, "EmuCore/GS", "EnableVideoCapture", true); SettingWidgetBinder::BindWidgetToIntSetting( diff --git a/pcsx2-qt/Settings/GraphicsSettingsWidget.ui b/pcsx2-qt/Settings/GraphicsSettingsWidget.ui index 990cfa78b275b0..be4a629da7f1d5 100644 --- a/pcsx2-qt/Settings/GraphicsSettingsWidget.ui +++ b/pcsx2-qt/Settings/GraphicsSettingsWidget.ui @@ -40,7 +40,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -76,7 +76,7 @@ - + @@ -86,7 +86,7 @@ - + Fit to Window / Fullscreen @@ -117,7 +117,7 @@ - + Off (Default) @@ -148,7 +148,7 @@ - + Automatic (Default) @@ -209,7 +209,7 @@ - + None @@ -235,7 +235,7 @@ - + % @@ -264,7 +264,7 @@ - + px @@ -281,7 +281,7 @@ - + px @@ -298,7 +298,7 @@ - + px @@ -315,7 +315,7 @@ - + px @@ -399,7 +399,7 @@ - + Screen Resolution @@ -418,7 +418,7 @@ - + PNG @@ -439,7 +439,7 @@ - + % @@ -468,7 +468,7 @@ - + @@ -478,7 +478,7 @@ - + Automatic (Default) @@ -509,7 +509,7 @@ - + Nearest @@ -540,7 +540,7 @@ - + Automatic (Default) @@ -571,7 +571,7 @@ - + @@ -581,7 +581,7 @@ - + Off @@ -607,7 +607,7 @@ - + Minimum @@ -648,7 +648,7 @@ - + None @@ -706,7 +706,7 @@ - + true @@ -749,7 +749,7 @@ - + threads @@ -788,7 +788,7 @@ - + Automatic (Default) @@ -816,7 +816,7 @@ - + 0 (Disabled) @@ -875,7 +875,7 @@ - + Sprites Only @@ -903,7 +903,7 @@ - + 0 (Disabled) @@ -935,7 +935,7 @@ - + Disabled (Default) @@ -961,7 +961,7 @@ - + Disabled (Default) @@ -987,7 +987,7 @@ - + Disabled (Default) @@ -1015,14 +1015,14 @@ - + 10000 - + 10000 @@ -1119,7 +1119,7 @@ - + Off (Default) @@ -1150,7 +1150,7 @@ - + Off (Default) @@ -1185,7 +1185,7 @@ - + 1000 @@ -1199,7 +1199,7 @@ - + 1000 @@ -1380,7 +1380,7 @@ - + None (Default) @@ -1408,7 +1408,7 @@ - + % @@ -1448,7 +1448,7 @@ - + None (Default) @@ -1511,7 +1511,7 @@ - + 1 @@ -1528,7 +1528,7 @@ - + 1 @@ -1545,7 +1545,7 @@ - + 1 @@ -1593,7 +1593,7 @@ - + % @@ -1767,7 +1767,7 @@ - + @@ -1800,7 +1800,7 @@ - + @@ -1810,7 +1810,7 @@ - + kbps @@ -1868,7 +1868,7 @@ - + @@ -1878,7 +1878,7 @@ - + kbps @@ -1903,7 +1903,7 @@ - + 320 @@ -1926,7 +1926,7 @@ - + 240 @@ -2009,7 +2009,7 @@ - + Accurate (Recommended) @@ -2040,7 +2040,7 @@ - + Uncompressed @@ -2091,7 +2091,7 @@ - + Automatic (Default) @@ -2126,7 +2126,7 @@ - + Automatic (Default) @@ -2218,6 +2218,18 @@ + + + NoScrollQComboBox + QComboBox +
NoScrollQComboBox.h
+
+ + NoScrollQSpinBox + QComboBox +
NoScrollQSpinBox.h
+
+
diff --git a/pcsx2-qt/Settings/GraphicsSettingsWidget.ui.autosave b/pcsx2-qt/Settings/GraphicsSettingsWidget.ui.autosave new file mode 100644 index 00000000000000..a2210bd67530ff --- /dev/null +++ b/pcsx2-qt/Settings/GraphicsSettingsWidget.ui.autosave @@ -0,0 +1,1644 @@ + + + GraphicsSettingsWidget + + + + 0 + 0 + 720 + 488 + + + + Form + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + + + + + + Renderer: + + + + + + + + + + Adapter: + + + + + + + + + + + + + 8 + + + true + + + + Display + + + + + + Fullscreen Mode: + + + + + + + + + + Aspect Ratio: + + + + + + + + + + FMV Aspect Ratio: + + + + + + + + + + Deinterlacing: + + + + + + + + + + Bilinear Filtering: + + + + + + + + + + Vertical Stretch: + + + + + + + % + + + 1 + + + 300 + + + + + + + Crop: + + + + + + + + + Left: + + + + + + + px + + + 1000 + + + + + + + Top: + + + + + + + px + + + 1000 + + + + + + + Right: + + + + + + + px + + + 1000 + + + + + + + Bottom: + + + + + + + px + + + 1000 + + + + + + + + + + + Screen Offsets + + + + + + + Integer Scaling + + + + + + + VSync + + + + + + + Show Overscan + + + + + + + Enable Widescreen Patches + + + + + + + Enable No-Interlacing Patches + + + + + + + Anti-Blur + + + Ctrl+S + + + + + + + Disable Interlace Offset + + + + + + + + + Screenshot Size: + + + + + + + + + + + + + + + Quality: + + + + + + + % + + + 1 + + + 100 + + + + + + + + + + Rendering + + + + + + Internal Resolution: + + + + + + + + + + Mipmapping: + + + + + + + + + + Texture Filtering: + + + + + + + + + + Trilinear Filtering: + + + + + + + + + + Anisotropic Filtering: + + + + + + + + + + Dithering: + + + + + + + + + + Blending Accuracy: + + + + + + + + + + Texture Preloading: + + + + + + + + + + + + Spin GPU During Readbacks + + + + + + + Manual Hardware Renderer Fixes + + + + + + + Spin CPU During Readbacks + + + + + + + + + + Rendering + + + + + + Texture Filtering: + + + + + + + true + + + + 0 + 0 + + + + Qt::LeftToRight + + + + + + + Extra Rendering Threads: + + + + + + + threads + + + + + + + + + Mipmapping + + + + + + + Auto Flush + + + + + + + + + + Hardware Fixes + + + + + + Half Screen Fix: + + + + + + + + + + CPU Sprite Render Size: + + + + + + + + + + + + + + + + + Software CLUT Render: + + + + + + + 0 (Disabled) + + + 0 + + + + + + + GPU Target CLUT: + + + + + + + + + + Auto Flush: + + + + + + + + + + Texture Inside RT: + + + + + + + + + + Skipdraw Range: + + + + + + + + + 10000 + + + + + + + 10000 + + + + + + + + + + + Disable Depth Emulation + + + + + + + Disable Partial Source Invalidation + + + + + + + Disable Safe Features + + + + + + + Target Partial Invalidation + + + + + + + Read Targets When Closing + + + + + + + Preload Frame Data + + + + + + + GPU Palette Conversion + + + + + + + Frame Buffer Conversion + + + + + + + Estimate Texture Region + + + + + + + Disable Render Fixes + + + + + + + + + + Upscaling Fixes + + + + + + Half Pixel Offset: + + + + + + + + + + Round Sprite: + + + + + + + + + + Texture Offsets: + + + + + + + + + X: + + + + + + + 1000 + + + + + + + Y: + + + + + + + 1000 + + + + + + + + + + + Align Sprite + + + + + + + Bilinear Dirty Upscale + + + + + + + Merge Sprite + + + + + + + Unscaled Palette Texture Draws + + + + + + + Wild Arms Hack + + + + + + + + + + Texture Replacement + + + + + + Search Directory + + + + + + + + + Browse... + + + + + + + Open... + + + + + + + Reset + + + + + + + PCSX2 will dump and load texture replacements from this directory. + + + + + + + + + + Options + + + + + + Dump Textures + + + + + + + Dump Mipmaps + + + + + + + Dump FMV Textures + + + + + + + Async Texture Loading + + + + + + + Load Textures + + + + + + + Precache Textures + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Post-Processing + + + + + + Sharpening/Anti-Aliasing + + + + + + Contrast Adaptive Sharpening: + + + + + + + + + + + + + + Sharpness: + + + + + + + % + + + 100 + + + 50 + + + + + + + + + + + FXAA + + + + + + + + + + Filters + + + + + + TV Shader: + + + + + + + + + + Shade Boost + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Brightness: + + + + + + + 1 + + + 100 + + + + + + + Contrast: + + + + + + + 1 + + + 100 + + + + + + + Saturation + + + + + + + 1 + + + 100 + + + + + + + + + + + + Qt::Vertical + + + + 20 + 111 + + + + + + + + + OSD + + + + + + On-Screen Display + + + + + + OSD Scale: + + + + + + + % + + + 50 + + + 500 + + + + + + + + + Show Indicators + + + + + + + Show Resolution + + + + + + + Show Inputs + + + + + + + Show GPU Usage + + + + + + + Show Settings + + + + + + + Show FPS + + + + + + + Show OSD Messages + + + + + + + Show Statistics + + + + + + + Show CPU Usage + + + + + + + Show Speed Percentages + + + + + + + Warn About Unsafe Settings + + + + + + + Show Frame Times + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Recording + + + + + + Video Dumping Directory + + + + + + + + + + + Browse... + + + + + + + Open... + + + + + + + Reset + + + + + + + + + + + + Capture Setup + + + + + + Container: + + + + + + + + + + 20 + + + 10 + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Codec: + + + + + + + + + + Bitrate: + + + + + + + kbps + + + 16 + + + 2048 + + + 1 + + + + + + + Extra Arguments + + + + + + + + + + + + + Capture Audio + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Codec: + + + + + + + + + + Bitrate: + + + + + + + kbps + + + 100 + + + 100000 + + + 100 + + + + + + + Resolution: + + + + + + + + + 320 + + + 32768 + + + 16 + + + 640 + + + + + + + x + + + + + + + 240 + + + 32768 + + + 16 + + + 240 + + + + + + + Auto + + + + + + + + + Extra Arguments + + + + + + + + + + + + + Capture Video + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + Advanced + + + + + + Advanced Options + + + + + + Hardware Download Mode: + + + + + + + + + + GS Dump Compression: + + + + + + + + + + + + Skip Presenting Duplicate Frames + + + + + + + Use Blit Swap Chain + + + + + + + Disable Threaded Presentation + + + + + + + + + Allow Exclusive Fullscreen: + + + + + + + + + + + + + Debugging Options + + + + + + Override Texture Barriers: + + + + + + + + + + + + Disable Framebuffer Fetch + + + + + + + Disable Dual Source Blending + + + + + + + Disable Shader Cache + + + + + + + Use Debug Device + + + + + + + Disable Vertex Shader Expand + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + Qt::Vertical + + + + 40 + 60 + + + + + + + + + NoScrollQComboBox + QWidget +
NoScrollQComboBox.h
+
+
+ + +
diff --git a/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp b/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp index 393914dd9abc12..aa1d73f6a12206 100644 --- a/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp +++ b/pcsx2-qt/Settings/InterfaceSettingsWidget.cpp @@ -93,11 +93,11 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsDialog* dialog, QWidget SettingWidgetBinder::BindWidgetToEnumSetting(sif, m_ui.theme, "UI", "Theme", THEME_NAMES, THEME_VALUES, QtHost::GetDefaultThemeName(), "InterfaceSettingsWidget"); - connect(m_ui.theme, QOverload::of(&QComboBox::currentIndexChanged), [this]() { emit themeChanged(); }); + connect(m_ui.theme, QOverload::of(&NoScrollQComboBox::currentIndexChanged), [this]() { emit themeChanged(); }); populateLanguages(); SettingWidgetBinder::BindWidgetToStringSetting(sif, m_ui.language, "UI", "Language", QtHost::GetDefaultLanguage()); - connect(m_ui.language, QOverload::of(&QComboBox::currentIndexChanged), [this]() { emit languageChanged(); }); + connect(m_ui.language, QOverload::of(&NoScrollQComboBox::currentIndexChanged), [this]() { emit languageChanged(); }); // Per-game settings is special, we don't want to bind it if we're editing per-game settings. m_ui.perGameSettings->setEnabled(!dialog->isPerGameSettings()); diff --git a/pcsx2-qt/Settings/InterfaceSettingsWidget.ui b/pcsx2-qt/Settings/InterfaceSettingsWidget.ui index be2e5d615dab2e..6ba064e4ba17f9 100644 --- a/pcsx2-qt/Settings/InterfaceSettingsWidget.ui +++ b/pcsx2-qt/Settings/InterfaceSettingsWidget.ui @@ -156,7 +156,7 @@
- + @@ -166,7 +166,7 @@ - +
@@ -185,7 +185,7 @@
- + @@ -250,6 +250,13 @@
+ + + NoScrollQComboBox + QComboBox +
NoScrollQComboBox.h
+
+
diff --git a/pcsx2-qt/Settings/MemoryCardConvertDialog.cpp b/pcsx2-qt/Settings/MemoryCardConvertDialog.cpp index f8524cd88d54fd..46ad71ee4c7ba2 100644 --- a/pcsx2-qt/Settings/MemoryCardConvertDialog.cpp +++ b/pcsx2-qt/Settings/MemoryCardConvertDialog.cpp @@ -51,7 +51,7 @@ MemoryCardConvertDialog::MemoryCardConvertDialog(QWidget* parent, QString select m_ui.progressBar->setRange(0, 100); m_ui.progressBar->setValue(0); - connect(m_ui.conversionTypeSelect, &QComboBox::currentIndexChanged, this, [this]() + connect(m_ui.conversionTypeSelect, &NoScrollQComboBox::currentIndexChanged, this, [this]() { switch (m_srcCardInfo.type) { diff --git a/pcsx2-qt/Settings/MemoryCardConvertDialog.ui b/pcsx2-qt/Settings/MemoryCardConvertDialog.ui index 7fb3bf86e1ed9c..d8ad2c334a4e69 100644 --- a/pcsx2-qt/Settings/MemoryCardConvertDialog.ui +++ b/pcsx2-qt/Settings/MemoryCardConvertDialog.ui @@ -30,7 +30,7 @@ - + 8 MB File @@ -134,6 +134,13 @@
+ + + NoScrollQComboBox + QComboBox +
NoScrollQComboBox.h
+
+
diff --git a/pcsx2-qt/Settings/USBDeviceWidget.ui b/pcsx2-qt/Settings/USBDeviceWidget.ui index 0efa61e430b42b..93983a0657cf60 100644 --- a/pcsx2-qt/Settings/USBDeviceWidget.ui +++ b/pcsx2-qt/Settings/USBDeviceWidget.ui @@ -35,10 +35,10 @@ - + - + @@ -135,6 +135,13 @@
+ + + NoScrollQComboBox + QComboBox +
NoScrollQComboBox.h
+
+
diff --git a/pcsx2-qt/SetupWizardDialog.cpp b/pcsx2-qt/SetupWizardDialog.cpp index 7e08384cb395d6..6096eb5e946318 100644 --- a/pcsx2-qt/SetupWizardDialog.cpp +++ b/pcsx2-qt/SetupWizardDialog.cpp @@ -195,14 +195,14 @@ void SetupWizardDialog::setupLanguagePage() { SettingWidgetBinder::BindWidgetToEnumSetting(nullptr, m_ui.theme, "UI", "Theme", InterfaceSettingsWidget::THEME_NAMES, InterfaceSettingsWidget::THEME_VALUES, QtHost::GetDefaultThemeName(), "InterfaceSettingsWidget"); - connect(m_ui.theme, QOverload::of(&QComboBox::currentIndexChanged), this, &SetupWizardDialog::themeChanged); + connect(m_ui.theme, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, &SetupWizardDialog::themeChanged); for (const std::pair& it : QtHost::GetAvailableLanguageList()) m_ui.language->addItem(it.first, it.second); SettingWidgetBinder::BindWidgetToStringSetting( nullptr, m_ui.language, "UI", "Language", QtHost::GetDefaultLanguage()); connect( - m_ui.language, QOverload::of(&QComboBox::currentIndexChanged), this, &SetupWizardDialog::languageChanged); + m_ui.language, QOverload::of(&NoScrollQComboBox::currentIndexChanged), this, &SetupWizardDialog::languageChanged); SettingWidgetBinder::BindWidgetToBoolSetting( nullptr, m_ui.autoUpdateEnabled, "AutoUpdater", "CheckAtStartup", true); @@ -400,7 +400,7 @@ void SetupWizardDialog::setupControllerPage() struct PadWidgets { - QComboBox* type_combo; + NoScrollQComboBox* type_combo; QLabel* mapping_result; QToolButton* mapping_button; }; diff --git a/pcsx2-qt/SetupWizardDialog.ui b/pcsx2-qt/SetupWizardDialog.ui index 773a25f9399ba3..aa97e413ec9ba2 100644 --- a/pcsx2-qt/SetupWizardDialog.ui +++ b/pcsx2-qt/SetupWizardDialog.ui @@ -159,7 +159,7 @@
- + 200 @@ -176,7 +176,7 @@ - + @@ -448,7 +448,7 @@ - + @@ -519,7 +519,7 @@ - + @@ -661,6 +661,13 @@ + + + NoScrollQComboBox + QComboBox +
NoScrollQComboBox.h
+
+