diff --git a/Source/Core/DolphinQt2/Debugger/BreakpointWidget.cpp b/Source/Core/DolphinQt2/Debugger/BreakpointWidget.cpp index 81db52cc0b..093b3767fb 100644 --- a/Source/Core/DolphinQt2/Debugger/BreakpointWidget.cpp +++ b/Source/Core/DolphinQt2/Debugger/BreakpointWidget.cpp @@ -16,8 +16,10 @@ #include "Core/PowerPC/BreakPoints.h" #include "Core/PowerPC/PPCSymbolDB.h" #include "Core/PowerPC/PowerPC.h" + #include "DolphinQt2/Debugger/NewBreakpointDialog.h" #include "DolphinQt2/QtUtils/ActionHelper.h" +#include "DolphinQt2/Resources.h" #include "DolphinQt2/Settings.h" BreakpointWidget::BreakpointWidget(QWidget* parent) : QDockWidget(parent) @@ -47,6 +49,9 @@ BreakpointWidget::BreakpointWidget(QWidget* parent) : QDockWidget(parent) setHidden(!enabled || !Settings::Instance().IsBreakpointsVisible()); }); + connect(&Settings::Instance(), &Settings::ThemeChanged, this, &BreakpointWidget::UpdateIcons); + UpdateIcons(); + setHidden(!Settings::Instance().IsBreakpointsVisible() || !Settings::Instance().IsDebugModeEnabled()); @@ -64,6 +69,8 @@ BreakpointWidget::~BreakpointWidget() void BreakpointWidget::CreateWidgets() { m_toolbar = new QToolBar; + m_toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + m_table = new QTableWidget; m_table->setColumnCount(5); m_table->setSelectionMode(QAbstractItemView::SingleSelection); @@ -75,9 +82,9 @@ void BreakpointWidget::CreateWidgets() layout->addWidget(m_toolbar); layout->addWidget(m_table); - AddAction(m_toolbar, tr("New"), this, &BreakpointWidget::OnNewBreakpoint); - AddAction(m_toolbar, tr("Delete"), this, &BreakpointWidget::OnDelete); - AddAction(m_toolbar, tr("Clear"), this, &BreakpointWidget::OnClear); + m_new = AddAction(m_toolbar, tr("New"), this, &BreakpointWidget::OnNewBreakpoint); + m_delete = AddAction(m_toolbar, tr("Delete"), this, &BreakpointWidget::OnDelete); + m_clear = AddAction(m_toolbar, tr("Clear"), this, &BreakpointWidget::OnClear); m_load = AddAction(m_toolbar, tr("Load"), this, &BreakpointWidget::OnLoad); m_save = AddAction(m_toolbar, tr("Save"), this, &BreakpointWidget::OnSave); @@ -91,6 +98,15 @@ void BreakpointWidget::CreateWidgets() setWidget(widget); } +void BreakpointWidget::UpdateIcons() +{ + m_new->setIcon(Resources::GetScaledThemeIcon("debugger_add_breakpoint")); + m_delete->setIcon(Resources::GetScaledThemeIcon("debugger_delete")); + m_clear->setIcon(Resources::GetScaledThemeIcon("debugger_clear")); + m_load->setIcon(Resources::GetScaledThemeIcon("debugger_load")); + m_save->setIcon(Resources::GetScaledThemeIcon("debugger_save")); +} + void BreakpointWidget::closeEvent(QCloseEvent*) { Settings::Instance().SetBreakpointsVisible(false); diff --git a/Source/Core/DolphinQt2/Debugger/BreakpointWidget.h b/Source/Core/DolphinQt2/Debugger/BreakpointWidget.h index 5dea2d517a..e7c5c93226 100644 --- a/Source/Core/DolphinQt2/Debugger/BreakpointWidget.h +++ b/Source/Core/DolphinQt2/Debugger/BreakpointWidget.h @@ -42,8 +42,13 @@ private: void OnLoad(); void OnSave(); + void UpdateIcons(); + QToolBar* m_toolbar; QTableWidget* m_table; + QAction* m_new; + QAction* m_delete; + QAction* m_clear; QAction* m_load; QAction* m_save; }; diff --git a/Source/Core/DolphinQt2/Debugger/CodeViewWidget.cpp b/Source/Core/DolphinQt2/Debugger/CodeViewWidget.cpp index e792727deb..1130ca7e7b 100644 --- a/Source/Core/DolphinQt2/Debugger/CodeViewWidget.cpp +++ b/Source/Core/DolphinQt2/Debugger/CodeViewWidget.cpp @@ -28,6 +28,7 @@ #include "Core/PowerPC/PowerPC.h" #include "DolphinQt2/Debugger/CodeWidget.h" #include "DolphinQt2/QtUtils/ActionHelper.h" +#include "DolphinQt2/Resources.h" #include "DolphinQt2/Settings.h" constexpr size_t VALID_BRANCH_LENGTH = 10; @@ -49,7 +50,6 @@ CodeViewWidget::CodeViewWidget() verticalHeader()->hide(); horizontalHeader()->hide(); horizontalHeader()->setStretchLastSection(true); - horizontalHeader()->resizeSection(0, 32); setFont(Settings::Instance().GetDebugFont()); @@ -61,6 +61,8 @@ CodeViewWidget::CodeViewWidget() m_address = PC; Update(); }); + + connect(&Settings::Instance(), &Settings::ThemeChanged, this, &CodeViewWidget::Update); } static u32 GetBranchFromAddress(u32 addr) @@ -151,7 +153,8 @@ void CodeViewWidget::Update() if (PowerPC::debug_interface.IsBreakpoint(addr)) { - bp_item->setBackground(Qt::red); + bp_item->setData(Qt::DecorationRole, + Resources::GetScaledThemeIcon("debugger_breakpoint").pixmap(QSize(24, 24))); } setItem(i, 0, bp_item); @@ -166,6 +169,8 @@ void CodeViewWidget::Update() } } + setColumnWidth(0, 24 + 5); + g_symbolDB.FillInCallers(); repaint(); diff --git a/Source/Core/DolphinQt2/Debugger/MemoryViewWidget.cpp b/Source/Core/DolphinQt2/Debugger/MemoryViewWidget.cpp index 50fcc78cc7..0ce8327cb2 100644 --- a/Source/Core/DolphinQt2/Debugger/MemoryViewWidget.cpp +++ b/Source/Core/DolphinQt2/Debugger/MemoryViewWidget.cpp @@ -15,7 +15,9 @@ #include "Core/Core.h" #include "Core/PowerPC/BreakPoints.h" #include "Core/PowerPC/PowerPC.h" + #include "DolphinQt2/QtUtils/ActionHelper.h" +#include "DolphinQt2/Resources.h" #include "DolphinQt2/Settings.h" MemoryViewWidget::MemoryViewWidget(QWidget* parent) : QTableWidget(parent) @@ -31,6 +33,7 @@ MemoryViewWidget::MemoryViewWidget(QWidget* parent) : QTableWidget(parent) connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, [this] { Update(); }); connect(this, &MemoryViewWidget::customContextMenuRequested, this, &MemoryViewWidget::OnContextMenu); + connect(&Settings::Instance(), &Settings::ThemeChanged, this, &MemoryViewWidget::Update); setContextMenuPolicy(Qt::CustomContextMenu); @@ -65,8 +68,6 @@ void MemoryViewWidget::Update() setColumnCount(CalculateColumnCount(m_type)); - setColumnWidth(0, 24); - if (rowCount() == 0) setRowCount(1); @@ -88,7 +89,10 @@ void MemoryViewWidget::Update() bp_item->setData(Qt::UserRole, addr); if (PowerPC::memchecks.OverlapsMemcheck(addr, 16)) - bp_item->setBackground(Qt::red); + { + bp_item->setData(Qt::DecorationRole, + Resources::GetScaledThemeIcon("debugger_breakpoint").pixmap(QSize(24, 24))); + } setItem(i, 0, bp_item); @@ -240,6 +244,7 @@ void MemoryViewWidget::Update() } } + setColumnWidth(0, 24 + 5); for (int i = 1; i < columnCount(); i++) { resizeColumnToContents(i); diff --git a/Source/Core/DolphinQt2/Debugger/WatchWidget.cpp b/Source/Core/DolphinQt2/Debugger/WatchWidget.cpp index 01caf96deb..2a4cc9b8e3 100644 --- a/Source/Core/DolphinQt2/Debugger/WatchWidget.cpp +++ b/Source/Core/DolphinQt2/Debugger/WatchWidget.cpp @@ -9,7 +9,9 @@ #include "Core/ConfigManager.h" #include "Core/Core.h" #include "Core/PowerPC/PowerPC.h" + #include "DolphinQt2/QtUtils/ActionHelper.h" +#include "DolphinQt2/Resources.h" #include "DolphinQt2/Settings.h" #include @@ -51,6 +53,9 @@ WatchWidget::WatchWidget(QWidget* parent) : QDockWidget(parent) connect(&Settings::Instance(), &Settings::DebugModeToggled, [this](bool enabled) { setHidden(!enabled || !Settings::Instance().IsWatchVisible()); }); + connect(&Settings::Instance(), &Settings::ThemeChanged, this, &WatchWidget::UpdateIcons); + UpdateIcons(); + setHidden(!Settings::Instance().IsWatchVisible() || !Settings::Instance().IsDebugModeEnabled()); Update(); @@ -67,6 +72,8 @@ WatchWidget::~WatchWidget() void WatchWidget::CreateWidgets() { m_toolbar = new QToolBar; + m_toolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); + m_table = new QTableWidget; m_table->setColumnCount(5); @@ -96,6 +103,12 @@ void WatchWidget::ConnectWidgets() connect(m_table, &QTableWidget::itemChanged, this, &WatchWidget::OnItemChanged); } +void WatchWidget::UpdateIcons() +{ + m_load->setIcon(Resources::GetScaledThemeIcon("debugger_load")); + m_save->setIcon(Resources::GetScaledThemeIcon("debugger_save")); +} + void WatchWidget::Update() { m_updating = true; diff --git a/Source/Core/DolphinQt2/Debugger/WatchWidget.h b/Source/Core/DolphinQt2/Debugger/WatchWidget.h index 26cb76378f..a405f60fba 100644 --- a/Source/Core/DolphinQt2/Debugger/WatchWidget.h +++ b/Source/Core/DolphinQt2/Debugger/WatchWidget.h @@ -42,6 +42,8 @@ private: void DeleteWatch(int row); void AddWatchBreakpoint(int row); + void UpdateIcons(); + QAction* m_load; QAction* m_save; QToolBar* m_toolbar; diff --git a/Source/Core/DolphinQt2/ToolBar.cpp b/Source/Core/DolphinQt2/ToolBar.cpp index 031937945f..a46efe26b3 100644 --- a/Source/Core/DolphinQt2/ToolBar.cpp +++ b/Source/Core/DolphinQt2/ToolBar.cpp @@ -104,6 +104,13 @@ void ToolBar::MakeActions() void ToolBar::UpdateIcons() { + m_step_action->setIcon(Resources::GetScaledThemeIcon("debugger_step_in")); + m_step_over_action->setIcon(Resources::GetScaledThemeIcon("debugger_step_over")); + m_step_out_action->setIcon(Resources::GetScaledThemeIcon("debugger_step_out")); + m_skip_action->setIcon(Resources::GetScaledThemeIcon("debugger_skip")); + m_show_pc_action->setIcon(Resources::GetScaledThemeIcon("debugger_set_pc")); + m_set_pc_action->setIcon(Resources::GetScaledThemeIcon("debugger_show_pc")); + m_open_action->setIcon(Resources::GetScaledThemeIcon("open")); m_play_action->setIcon(Resources::GetScaledThemeIcon("play")); m_pause_action->setIcon(Resources::GetScaledThemeIcon("pause"));