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 9e0546d
Show file tree
Hide file tree
Showing 39 changed files with 2,066 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
CustomQtWidgets/NoScrollQComboBox.h
CustomQtWidgets/NoScrollQDoubleSpinBox.h
CustomQtWidgets/NoScrollQSpinBox.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/CustomQtWidgets"
)

target_link_libraries(pcsx2-qt PRIVATE
Expand Down
16 changes: 16 additions & 0 deletions pcsx2-qt/CustomQtWidgets/NoScrollQComboBox.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once
#include <QtWidgets/QComboBox>

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);
}
};
16 changes: 16 additions & 0 deletions pcsx2-qt/CustomQtWidgets/NoScrollQDoubleSpinBox.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once
#include <QtWidgets/QDoubleSpinBox>

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);
}
};
16 changes: 16 additions & 0 deletions pcsx2-qt/CustomQtWidgets/NoScrollQSpinBox.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once
#include <QtWidgets/QSpinBox>

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);
}
};
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, &NoScrollQComboBox::currentIndexChanged, [this](int i) {
if (i < 4)
m_ui.chkSearchHex->setEnabled(true);
else
Expand Down
7 changes: 6 additions & 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="NoScrollQComboBox" name="cmbSearchType">
<item>
<property name="text">
<string>1 Byte (8 bits)</string>
Expand Down Expand Up @@ -524,6 +524,11 @@
<header>pcsx2-qt/Debugger/MemoryViewWidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>NoScrollQComboBox</class>
<extends>QComboBox</extends>
<header>NoScrollQComboBox.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
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, &NoScrollQComboBox::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, &NoScrollQComboBox::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
11 changes: 9 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="NoScrollQComboBox" 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="NoScrollQComboBox" name="filterRegion">
<item>
<property name="text">
<string>All Regions</string>
Expand Down Expand Up @@ -213,6 +213,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>NoScrollQComboBox</class>
<extends>QComboBox</extends>
<header>NoScrollQComboBox.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../resources/resources.qrc"/>
</resources>
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 "CustomQtWidgets/NoScrollQComboBox.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 NoScrollQComboBox;
class QFrame;
class QKeyEvent;
class QTableView;
Expand Down
Loading

0 comments on commit 9e0546d

Please sign in to comment.