Compare commits

...

7 Commits

Author SHA1 Message Date
lightningterror
ff87bc5889 GS: Use inclusive req factor of 1 for sw renderer.
Workaround until the issue can be properly fixed.
2025-04-14 23:02:43 +02:00
Rares-Alexandru Fodor
42cd80c172 UI: Fix vertical alignment of achievement progress text 2025-04-14 23:02:19 +02:00
TheLastRar
123cd3a092 Qt: Centre region flags in game list 2025-04-14 18:11:48 +02:00
TheLastRar
cbc3c4e6eb Qt: Fix broken icon styling in Win11 theme 2025-04-14 18:11:48 +02:00
PCSX2 Bot
b50e39e5cb [ci skip] PAD: Update to latest controller database. 2025-04-14 18:11:21 +02:00
PCSX2 Bot
bbe5ef451a [ci skip] Qt: Update Base Translation. 2025-04-12 20:54:51 -04:00
chaoticgd
c359c0e747 Debugger: Add setting to change UI refresh interval 2025-04-12 12:26:32 -04:00
10 changed files with 1296 additions and 1167 deletions

View File

@@ -1590,6 +1590,7 @@ xinput,XInput Controller,a:b0,b:b1,back:b6,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,
030000009b2800003200000001010000,Raphnet GC and N64 Adapter,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Linux,
030000009b2800006000000001010000,Raphnet GC and N64 Adapter,a:b0,b:b7,dpdown:b11,dpleft:b12,dpright:b13,dpup:b10,lefttrigger:b4,leftx:a0,lefty:a1,rightshoulder:b2,righttrigger:b5,rightx:a3,righty:a4,start:b3,x:b1,y:b8,platform:Linux,
030000009b2800008000000020020000,Raphnet Wii Classic Adapter,a:b1,b:b4,back:b2,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,leftshoulder:b6,rightshoulder:b7,start:b3,x:b0,y:b5,platform:Linux,
030000009b2800008000000001010000,Raphnet Wii Classic Adapter V3,a:b1,b:b4,back:b2,dpdown:b13,dpleft:b14,dpright:b15,dpup:b12,leftshoulder:b6,rightshoulder:b7,start:b3,x:b0,y:b5,platform:Linux,
03000000f8270000bf0b000011010000,Razer Kishi,a:b0,b:b1,back:b10,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b6,leftstick:b13,lefttrigger:a5,leftx:a0,lefty:a1,rightshoulder:b7,rightstick:b14,righttrigger:a4,rightx:a2,righty:a3,start:b11,x:b3,y:b4,platform:Linux,
030000008916000001fd000024010000,Razer Onza Classic Edition,a:b0,b:b1,back:b6,dpdown:b14,dpleft:b11,dpright:b12,dpup:b13,guide:b8,leftshoulder:b4,leftstick:b9,lefttrigger:a2,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b10,righttrigger:a5,rightx:a3,righty:a4,start:b7,x:b2,y:b3,platform:Linux,
03000000321500000204000011010000,Razer Panthera PS3,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a3,start:b9,x:b0,y:b3,platform:Linux,

View File

@@ -120,11 +120,7 @@ DebuggerWindow::DebuggerWindow(QWidget* parent)
R5900SymbolImporter.OnDebuggerOpened();
});
QTimer* refresh_timer = new QTimer(this);
connect(refresh_timer, &QTimer::timeout, this, []() {
DebuggerWidget::broadcastEvent(DebuggerEvents::Refresh());
});
refresh_timer->start(1000);
updateFromSettings();
}
DebuggerWindow* DebuggerWindow::getInstance()
@@ -285,6 +281,25 @@ bool DebuggerWindow::shouldSaveWindowGeometry()
return Host::GetBaseBoolSettingValue("Debugger/UserInterface", "SaveWindowGeometry", true);
}
void DebuggerWindow::updateFromSettings()
{
const int refresh_interval = Host::GetBaseIntSettingValue("Debugger/UserInterface", "RefreshInterval", 1000);
const int effective_refresh_interval = std::clamp(refresh_interval, 10, 100000);
if (!m_refresh_timer)
{
m_refresh_timer = new QTimer(this);
connect(m_refresh_timer, &QTimer::timeout, this, []() {
DebuggerWidget::broadcastEvent(DebuggerEvents::Refresh());
});
m_refresh_timer->start(effective_refresh_interval);
}
else
{
m_refresh_timer->setInterval(effective_refresh_interval);
}
}
void DebuggerWindow::onVMStarting()
{
m_ui.actionRun->setEnabled(true);

View File

@@ -8,6 +8,7 @@
#include "DebugTools/DebugInterface.h"
#include <kddockwidgets/MainWindow.h>
#include <QtCore/QTimer>
class DockManager;
@@ -37,6 +38,8 @@ public:
void restoreWindowGeometry();
bool shouldSaveWindowGeometry();
void updateFromSettings();
public slots:
void onVMStarting();
void onVMPaused();
@@ -67,6 +70,7 @@ private:
DockManager* m_dock_manager;
QByteArray m_default_toolbar_state;
QTimer* m_refresh_timer = nullptr;
int m_font_size;
static const constexpr int DEFAULT_FONT_SIZE = 10;

View File

@@ -19,6 +19,7 @@
#include <QtCore/QSortFilterProxyModel>
#include <QtGui/QPainter>
#include <QtGui/QPixmap>
#include <QtGui/QPixmapCache>
#include <QtGui/QWheelEvent>
#include <QtWidgets/QApplication>
#include <QtWidgets/QHeaderView>
@@ -113,20 +114,51 @@ namespace
// https://stackoverflow.com/questions/32216568/how-to-set-icon-center-in-qtableview
Q_ASSERT(index.isValid());
// draw default item
// Draw the base item, with a blank icon
QStyleOptionViewItem opt = option;
initStyleOption(&opt, index);
opt.type = QStyleOption::SO_Default;
QApplication::style()->drawControl(QStyle::CE_ItemViewItem, &opt, painter, 0);
opt.icon = QIcon();
// Based on QStyledItemDelegate::paint()
const QStyle* style = option.widget ? option.widget->style() : QApplication::style();
style->drawControl(QStyle::CE_ItemViewItem, &opt, painter, option.widget);
// Fetch icon pixmap
const QRect r = option.rect;
const QPixmap pix = qvariant_cast<QPixmap>(index.data(Qt::DecorationRole));
const int pix_width = static_cast<int>(pix.width() / pix.devicePixelRatio());
const int pix_height = static_cast<int>(pix.width() / pix.devicePixelRatio());
const int pix_height = static_cast<int>(pix.height() / pix.devicePixelRatio());
// draw pixmap at center of item
// Draw the icon, using code derived from QItemDelegate::drawDecoration()
const bool enabled = option.state & QStyle::State_Enabled;
const QPoint p = QPoint((r.width() - pix_width) / 2, (r.height() - pix_height) / 2);
painter->drawPixmap(r.topLeft() + p, pix);
if (option.state & QStyle::State_Selected)
{
// See QItemDelegate::selectedPixmap()
QString key = QString::fromStdString(fmt::format("{:016X}-{:d}", pix.cacheKey(), enabled));
QPixmap pm;
if (!QPixmapCache::find(key, &pm))
{
QImage img = pix.toImage().convertToFormat(QImage::Format_ARGB32_Premultiplied);
QColor color = option.palette.color(enabled ? QPalette::Normal : QPalette::Disabled,
QPalette::Highlight);
color.setAlphaF(0.3f);
QPainter tinted_painter(&img);
tinted_painter.setCompositionMode(QPainter::CompositionMode_SourceAtop);
tinted_painter.fillRect(0, 0, img.width(), img.height(), color);
tinted_painter.end();
pm = QPixmap(QPixmap::fromImage(img));
QPixmapCache::insert(key, pm);
}
painter->drawPixmap(r.topLeft() + p, pm);
}
else
{
painter->drawPixmap(r.topLeft() + p, pix);
}
}
};
} // namespace
@@ -190,6 +222,7 @@ void GameListWidget::initialize()
m_table_view->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
m_table_view->setVerticalScrollMode(QAbstractItemView::ScrollMode::ScrollPerPixel);
m_table_view->setItemDelegateForColumn(0, new GameListIconStyleDelegate(this));
m_table_view->setItemDelegateForColumn(8, new GameListIconStyleDelegate(this));
loadTableViewColumnVisibilitySettings();
loadTableViewColumnSortSettings();

View File

@@ -4,6 +4,7 @@
#include "DebugUserInterfaceSettingsWidget.h"
#include "SettingWidgetBinder.h"
#include "Debugger/DebuggerWindow.h"
static const char* s_drop_indicators[] = {
QT_TRANSLATE_NOOP("DebugUserInterfaceSettingsWidget", "Classic"),
@@ -19,32 +20,40 @@ DebugUserInterfaceSettingsWidget::DebugUserInterfaceSettingsWidget(SettingsWindo
m_ui.setupUi(this);
SettingWidgetBinder::BindWidgetToBoolSetting(
sif, m_ui.showOnStartupCheckBox, "Debugger/UserInterface", "ShowOnStartup", false);
SettingWidgetBinder::BindWidgetToIntSetting(
sif, m_ui.refreshInterval, "Debugger/UserInterface", "RefreshInterval", 1000);
connect(m_ui.refreshInterval, &QSpinBox::valueChanged, this, []() {
if (g_debugger_window)
g_debugger_window->updateFromSettings();
});
dialog->registerWidgetHelp(
m_ui.showOnStartupCheckBox, tr("Show On Startup"), tr("Unchecked"),
m_ui.refreshInterval, tr("Refresh Interval"), tr("1000ms"),
tr("The amount of time to wait between subsequent attempts to update the user interface to reflect the state "
"of the virtual machine."));
SettingWidgetBinder::BindWidgetToBoolSetting(
sif, m_ui.showOnStartup, "Debugger/UserInterface", "ShowOnStartup", false);
dialog->registerWidgetHelp(
m_ui.showOnStartup, tr("Show On Startup"), tr("Unchecked"),
tr("Open the debugger window automatically when PCSX2 starts."));
SettingWidgetBinder::BindWidgetToBoolSetting(
sif, m_ui.saveWindowGeometryCheckBox, "Debugger/UserInterface", "SaveWindowGeometry", true);
sif, m_ui.saveWindowGeometry, "Debugger/UserInterface", "SaveWindowGeometry", true);
dialog->registerWidgetHelp(
m_ui.saveWindowGeometryCheckBox, tr("Save Window Geometry"), tr("Checked"),
m_ui.saveWindowGeometry, tr("Save Window Geometry"), tr("Checked"),
tr("Save the position and size of the debugger window when it is closed so that it can be restored later."));
SettingWidgetBinder::BindWidgetToEnumSetting(
sif,
m_ui.dropIndicatorCombo,
m_ui.dropIndicator,
"Debugger/UserInterface",
"DropIndicatorStyle",
s_drop_indicators,
s_drop_indicators,
s_drop_indicators[0],
"DebugUserInterfaceSettingsWidget");
dialog->registerWidgetHelp(
m_ui.dropIndicatorCombo, tr("Drop Indicator Style"), tr("Classic"),
m_ui.dropIndicator, tr("Drop Indicator Style"), tr("Classic"),
tr("Choose how the drop indicators that appear when you drag dock windows in the debugger are styled. "
"You will have to restart the debugger for this option to take effect."));
}

View File

@@ -38,15 +38,8 @@
<string>Debugger Window</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="1">
<widget class="QCheckBox" name="saveWindowGeometryCheckBox">
<property name="text">
<string>Save Window Geometry</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QCheckBox" name="showOnStartupCheckBox">
<item row="1" column="0">
<widget class="QCheckBox" name="showOnStartup">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
@@ -58,6 +51,36 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QCheckBox" name="saveWindowGeometry">
<property name="text">
<string>Save Window Geometry</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="refreshIntervalLabel">
<property name="text">
<string>Refresh Interval:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="refreshInterval">
<property name="suffix">
<string>ms</string>
</property>
<property name="minimum">
<number>10</number>
</property>
<property name="maximum">
<number>100000</number>
</property>
<property name="value">
<number>1000</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
@@ -76,12 +99,12 @@
<item row="0" column="0">
<widget class="QLabel" name="dropIndicatorLabel">
<property name="text">
<string>Drop Indicator Style</string>
<string>Drop Indicator Style:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="dropIndicatorCombo"/>
<widget class="QComboBox" name="dropIndicator"/>
</item>
</layout>
</widget>

File diff suppressed because it is too large Load Diff

View File

@@ -2266,7 +2266,9 @@ void Achievements::DrawAchievementsWindow()
ImGui::GetColorU32(ImGuiFullscreen::UISecondaryColor));
text.format("{}%", static_cast<int>(std::round(fraction * 100.0f)));
ImGui::PushFont(g_medium_font);
text_size = ImGui::CalcTextSize(text.c_str(), text.end_ptr());
ImGui::PopFont();
const ImVec2 text_pos(progress_bb.Min.x + ((progress_bb.Max.x - progress_bb.Min.x) / 2.0f) - (text_size.x / 2.0f),
progress_bb.Min.y + ((progress_bb.Max.y - progress_bb.Min.y) / 2.0f) - (text_size.y / 2.0f));
dl->AddText(g_medium_font, g_medium_font->FontSize, text_pos, ImGui::GetColorU32(ImGuiFullscreen::UIPrimaryTextColor),

View File

@@ -3929,8 +3929,9 @@ GSState::TextureMinMaxResult GSState::GetTextureMinMax(GIFRegTEX0 TEX0, GIFRegCL
// Need to make sure we don't oversample, this can cause trouble in grabbing textures.
// This may be inaccurate depending on the draw, but adding 1 all the time is wrong too.
const int inclusive_x_req = ((m_vt.m_primclass < GS_TRIANGLE_CLASS) || (grad.x < 1.0f || (grad.x == 1.0f && m_vt.m_max.p.x != floor(m_vt.m_max.p.x)))) ? 1 : 0;
const int inclusive_y_req = ((m_vt.m_primclass < GS_TRIANGLE_CLASS) || (grad.y < 1.0f || (grad.y == 1.0f && m_vt.m_max.p.y != floor(m_vt.m_max.p.y)))) ? 1 : 0;
// FIXME: It breaks sw renderer so let's still use 1 for SW mode for now.
const int inclusive_x_req = GSIsHardwareRenderer() ? (((m_vt.m_primclass < GS_TRIANGLE_CLASS) || (grad.x < 1.0f || (grad.x == 1.0f && m_vt.m_max.p.x != floor(m_vt.m_max.p.x)))) ? 1 : 0) : 1;
const int inclusive_y_req = GSIsHardwareRenderer() ? (((m_vt.m_primclass < GS_TRIANGLE_CLASS) || (grad.y < 1.0f || (grad.y == 1.0f && m_vt.m_max.p.y != floor(m_vt.m_max.p.y)))) ? 1 : 0) : 1;
// Roughly cut out the min/max of the read (Clamp)
switch (wms)

View File

@@ -7791,6 +7791,7 @@ TRANSLATE_NOOP("FullscreenUI", "Automatic mapping failed for {}.");
TRANSLATE_NOOP("FullscreenUI", "Game settings initialized with global settings for '{}'.");
TRANSLATE_NOOP("FullscreenUI", "Game settings have been cleared for '{}'.");
TRANSLATE_NOOP("FullscreenUI", "Uses {} as confirm when using a controller");
TRANSLATE_NOOP("FullscreenUI", "Swaps both {}/{} (When Swap OK/Cancel is set to automatic) and {}/{} buttons");
TRANSLATE_NOOP("FullscreenUI", "Slot {}");
TRANSLATE_NOOP("FullscreenUI", "{} (Current)");
TRANSLATE_NOOP("FullscreenUI", "{} (Folder)");
@@ -8063,6 +8064,7 @@ TRANSLATE_NOOP("FullscreenUI", "Confirm Shutdown");
TRANSLATE_NOOP("FullscreenUI", "Save State On Shutdown");
TRANSLATE_NOOP("FullscreenUI", "Create Save State Backups");
TRANSLATE_NOOP("FullscreenUI", "Swap OK/Cancel in Big Picture Mode");
TRANSLATE_NOOP("FullscreenUI", "Use Legacy Nintendo Layout in Big Picture Mode");
TRANSLATE_NOOP("FullscreenUI", "Enable Discord Presence");
TRANSLATE_NOOP("FullscreenUI", "Start Fullscreen");
TRANSLATE_NOOP("FullscreenUI", "Double-Click Toggles Fullscreen");