Skip to content

Commit

Permalink
scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesthobe committed Jul 2, 2023
1 parent f91f257 commit e461c5e
Show file tree
Hide file tree
Showing 39 changed files with 1,949 additions and 247 deletions.
4 changes: 4 additions & 0 deletions pcsx2-qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ target_sources(pcsx2-qt PRIVATE
Settings/SettingsDialog.ui
Settings/USBBindingWidget_DrivingForce.ui
Settings/USBBindingWidget_GTForce.ui
SubQtClasses/sub_q_combo_box.h
SubQtClasses/sub_q_double_spin_box.h
SubQtClasses/sub_q_spin_box.h
Debugger/CpuWidget.cpp
Debugger/CpuWidget.h
Debugger/CpuWidget.ui
Expand Down Expand Up @@ -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/SubQtClasses"
)

target_link_libraries(pcsx2-qt PRIVATE
Expand Down
2 changes: 1 addition & 1 deletion pcsx2-qt/Debugger/CpuWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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, &sub_q_combo_box::currentIndexChanged, [this](int i) {
if (i < 4)
m_ui.chkSearchHex->setEnabled(true);
else
Expand Down
2 changes: 1 addition & 1 deletion pcsx2-qt/Debugger/CpuWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="cmbSearchType">
<widget class="sub_q_combo_box" name="cmbSearchType">
<item>
<property name="text">
<string>1 Byte (8 bits)</string>
Expand Down
4 changes: 2 additions & 2 deletions pcsx2-qt/GameList/GameListWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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, &sub_q_combo_box::currentIndexChanged, this, [this](int index) {
m_sort_model->setFilterType((index == 0) ? GameList::EntryType::Count : static_cast<GameList::EntryType>(index - 1));
});
connect(m_ui.filterRegion, &QComboBox::currentIndexChanged, this, [this](int index) {
connect(m_ui.filterRegion, &sub_q_combo_box::currentIndexChanged, this, [this](int index) {
m_sort_model->setFilterRegion((index == 0) ? GameList::Region::Count : static_cast<GameList::Region>(index - 1));
});
connect(m_ui.searchText, &QLineEdit::textChanged, this, [this](const QString& text) {
Expand Down
4 changes: 2 additions & 2 deletions pcsx2-qt/GameList/GameListWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
<number>6</number>
</property>
<item>
<widget class="QComboBox" name="filterType">
<widget class="sub_q_combo_box" name="filterType">
<item>
<property name="text">
<string>All Types</string>
Expand All @@ -176,7 +176,7 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="filterRegion">
<widget class="sub_q_combo_box" name="filterRegion">
<item>
<property name="text">
<string>All Regions</string>
Expand Down
2 changes: 1 addition & 1 deletion pcsx2-qt/QtUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <QtGui/QDesktopServices>
#include <QtGui/QKeyEvent>
#include <QtGui/QScreen>
#include <QtWidgets/QComboBox>
#include "SubQtClasses/sub_q_combo_box.h"
#include <QtWidgets/QDialog>
#include <QtWidgets/QHeaderView>
#include <QtWidgets/QInputDialog>
Expand Down
2 changes: 1 addition & 1 deletion pcsx2-qt/QtUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class ByteStream;

class QAction;
class QComboBox;
class sub_q_combo_box;
class QFrame;
class QKeyEvent;
class QTableView;
Expand Down
160 changes: 80 additions & 80 deletions pcsx2-qt/SettingWidgetBinder.h

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions pcsx2-qt/Settings/AdvancedSettingsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>::of(&QComboBox::currentIndexChanged), [this](int index) { setClampingMode(-1, index); });
connect(m_ui.vu0ClampMode, QOverload<int>::of(&QComboBox::currentIndexChanged), [this](int index) { setClampingMode(0, index); });
connect(m_ui.vu1ClampMode, QOverload<int>::of(&QComboBox::currentIndexChanged), [this](int index) { setClampingMode(1, index); });
connect(m_ui.eeClampMode, QOverload<int>::of(&sub_q_combo_box::currentIndexChanged), [this](int index) { setClampingMode(-1, index); });
connect(m_ui.vu0ClampMode, QOverload<int>::of(&sub_q_combo_box::currentIndexChanged), [this](int index) { setClampingMode(0, index); });
connect(m_ui.vu1ClampMode, QOverload<int>::of(&sub_q_combo_box::currentIndexChanged), [this](int index) { setClampingMode(1, index); });

SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.iopRecompiler, "EmuCore/CPU/Recompiler", "EnableIOP", true);

Expand Down
16 changes: 8 additions & 8 deletions pcsx2-qt/Settings/AdvancedSettingsWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="eeRoundingMode">
<widget class="sub_q_combo_box" name="eeRoundingMode">
<item>
<property name="text">
<string>Nearest</string>
Expand Down Expand Up @@ -105,7 +105,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="eeClampMode">
<widget class="sub_q_combo_box" name="eeClampMode">
<item>
<property name="text">
<string comment="ClampMode">None</string>
Expand Down Expand Up @@ -191,7 +191,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="vu0RoundingMode">
<widget class="sub_q_combo_box" name="vu0RoundingMode">
<item>
<property name="text">
<string>Nearest</string>
Expand Down Expand Up @@ -240,7 +240,7 @@
</layout>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="vu0ClampMode">
<widget class="sub_q_combo_box" name="vu0ClampMode">
<item>
<property name="text">
<string>None</string>
Expand Down Expand Up @@ -285,7 +285,7 @@
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="vu1RoundingMode">
<widget class="sub_q_combo_box" name="vu1RoundingMode">
<item>
<property name="text">
<string>Nearest</string>
Expand All @@ -309,7 +309,7 @@
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="vu1ClampMode">
<widget class="sub_q_combo_box" name="vu1ClampMode">
<item>
<property name="text">
<string>None</string>
Expand Down Expand Up @@ -381,7 +381,7 @@
</property>
<layout class="QGridLayout" name="gridLayout_5">
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="palFrameRate">
<widget class="sub_q_double_spin_box" name="palFrameRate">
<property name="suffix">
<string extracomment="hz=Hertz, as in the measuring unit. Shown after the corresponding number. Those languages who'd need to remove the space or do something in between should do so."> hz</string>
</property>
Expand All @@ -391,7 +391,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QDoubleSpinBox" name="ntscFrameRate">
<widget class="sub_q_double_spin_box" name="ntscFrameRate">
<property name="suffix">
<string> hz</string>
</property>
Expand Down
8 changes: 4 additions & 4 deletions pcsx2-qt/Settings/AudioSettingsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>::of(&QComboBox::currentIndexChanged), this, &AudioSettingsWidget::updateTargetLatencyRange);
connect(m_ui.expansionMode, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &AudioSettingsWidget::expansionModeChanged);
connect(m_ui.syncMode, QOverload<int>::of(&sub_q_combo_box::currentIndexChanged), this, &AudioSettingsWidget::updateTargetLatencyRange);
connect(m_ui.expansionMode, QOverload<int>::of(&sub_q_combo_box::currentIndexChanged), this, &AudioSettingsWidget::expansionModeChanged);
updateTargetLatencyRange();
expansionModeChanged();

Expand All @@ -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, &sub_q_combo_box::currentIndexChanged, this, &AudioSettingsWidget::outputModuleChanged);
connect(m_ui.backend, &sub_q_combo_box::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);
Expand Down
12 changes: 6 additions & 6 deletions pcsx2-qt/Settings/AudioSettingsWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="syncMode">
<widget class="sub_q_combo_box" name="syncMode">
<item>
<property name="text">
<string>TimeStretch (Recommended)</string>
Expand All @@ -311,7 +311,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="expansionMode">
<widget class="sub_q_combo_box" name="expansionMode">
<item>
<property name="text">
<string>Stereo (None, Default)</string>
Expand Down Expand Up @@ -342,7 +342,7 @@
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="dplLevel">
<widget class="sub_q_combo_box" name="dplLevel">
<item>
<property name="text">
<string>None (Default)</string>
Expand Down Expand Up @@ -417,7 +417,7 @@
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="outputModule"/>
<widget class="sub_q_combo_box" name="outputModule"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_5">
Expand Down Expand Up @@ -474,7 +474,7 @@
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="backend"/>
<widget class="sub_q_combo_box" name="backend"/>
</item>
<item row="4" column="1">
<widget class="QLabel" name="latencySummary">
Expand All @@ -494,7 +494,7 @@
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="outputDevice"/>
<widget class="sub_q_combo_box" name="outputDevice"/>
</item>
</layout>
</widget>
Expand Down
2 changes: 1 addition & 1 deletion pcsx2-qt/Settings/ControllerBindingWidget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QComboBox" name="controllerType"/>
<widget class="sub_q_combo_box" name="controllerType"/>
</item>
<item>
<widget class="QToolButton" name="bindings">
Expand Down
22 changes: 11 additions & 11 deletions pcsx2-qt/Settings/ControllerBindingWidgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>::of(&QComboBox::currentIndexChanged), this, &ControllerBindingWidget::onTypeChanged);
connect(m_ui.controllerType, QOverload<int>::of(&sub_q_combo_box::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);
Expand Down Expand Up @@ -565,7 +565,7 @@ void ControllerCustomSettingsWidget::createSettingWidgets(const char* translatio

case SettingInfo::Type::Integer:
{
QSpinBox* sb = new QSpinBox(widget_parent);
sub_q_spin_box* sb = new sub_q_spin_box(widget_parent);
sb->setObjectName(QString::fromUtf8(si.name));
sb->setMinimum(si.IntegerMinValue());
sb->setMaximum(si.IntegerMaxValue());
Expand All @@ -586,7 +586,7 @@ void ControllerCustomSettingsWidget::createSettingWidgets(const char* translatio

case SettingInfo::Type::IntegerList:
{
QComboBox* cb = new QComboBox(widget_parent);
sub_q_combo_box* cb = new sub_q_combo_box(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]));
Expand All @@ -600,7 +600,7 @@ void ControllerCustomSettingsWidget::createSettingWidgets(const char* translatio

case SettingInfo::Type::Float:
{
QDoubleSpinBox* sb = new QDoubleSpinBox(widget_parent);
sub_q_double_spin_box* sb = new sub_q_double_spin_box(widget_parent);
sb->setObjectName(QString::fromUtf8(si.name));
sb->setMinimum(si.FloatMinValue() * si.multiplier);
sb->setMaximum(si.FloatMaxValue() * si.multiplier);
Expand Down Expand Up @@ -637,7 +637,7 @@ void ControllerCustomSettingsWidget::createSettingWidgets(const char* translatio

case SettingInfo::Type::StringList:
{
QComboBox* cb = new QComboBox(widget_parent);
sub_q_combo_box* cb = new sub_q_combo_box(widget_parent);
cb->setObjectName(QString::fromUtf8(si.name));
if (si.get_options)
{
Expand Down Expand Up @@ -718,23 +718,23 @@ void ControllerCustomSettingsWidget::restoreDefaults()

case SettingInfo::Type::Integer:
{
QSpinBox* widget = findChild<QSpinBox*>(QString::fromStdString(si.name));
sub_q_spin_box* widget = findChild<sub_q_spin_box*>(QString::fromStdString(si.name));
if (widget)
widget->setValue(si.IntegerDefaultValue());
}
break;

case SettingInfo::Type::IntegerList:
{
QComboBox* widget = findChild<QComboBox*>(QString::fromStdString(si.name));
sub_q_combo_box* widget = findChild<sub_q_combo_box*>(QString::fromStdString(si.name));
if (widget)
widget->setCurrentIndex(si.IntegerDefaultValue() - si.IntegerMinValue());
}
break;

case SettingInfo::Type::Float:
{
QDoubleSpinBox* widget = findChild<QDoubleSpinBox*>(QString::fromStdString(si.name));
sub_q_double_spin_box* widget = findChild<sub_q_double_spin_box*>(QString::fromStdString(si.name));
if (widget)
widget->setValue(si.FloatDefaultValue() * si.multiplier);
}
Expand All @@ -750,7 +750,7 @@ void ControllerCustomSettingsWidget::restoreDefaults()

case SettingInfo::Type::StringList:
{
QComboBox* widget = findChild<QComboBox*>(QString::fromStdString(si.name));
sub_q_combo_box* widget = findChild<sub_q_combo_box*>(QString::fromStdString(si.name));
if (widget)
{
const QString default_value(QString::fromUtf8(si.StringDefaultValue()));
Expand Down Expand Up @@ -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<int>::of(&QComboBox::currentIndexChanged), this, &USBDeviceWidget::onTypeChanged);
connect(m_ui.deviceSubtype, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &USBDeviceWidget::onSubTypeChanged);
connect(m_ui.deviceType, QOverload<int>::of(&sub_q_combo_box::currentIndexChanged), this, &USBDeviceWidget::onTypeChanged);
connect(m_ui.deviceSubtype, QOverload<int>::of(&sub_q_combo_box::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);
Expand Down
6 changes: 3 additions & 3 deletions pcsx2-qt/Settings/ControllerSettingWidgetBinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@
#include <QtCore/QtCore>
#include <QtGui/QAction>
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QComboBox>
#include <QtWidgets/QDoubleSpinBox>
#include "SubQtClasses/sub_q_combo_box.h"
#include "SubQtClasses/sub_q_double_spin_box.h"
#include <QtWidgets/QLineEdit>
#include <QtWidgets/QSlider>
#include <QtWidgets/QSpinBox>
#include "SubQtClasses/sub_q_spin_box.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.
Expand Down
2 changes: 1 addition & 1 deletion pcsx2-qt/Settings/ControllerSettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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, &sub_q_combo_box::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);
Expand Down
2 changes: 1 addition & 1 deletion pcsx2-qt/Settings/ControllerSettingsDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="currentProfile">
<widget class="sub_q_combo_box" name="currentProfile">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
Expand Down
Loading

0 comments on commit e461c5e

Please sign in to comment.