mirror of
https://github.com/PCSX2/pcsx2.git
synced 2025-12-16 04:08:48 +00:00
Debugger: Respond to OS colour scheme changes
Some checks are pending
🐧 Linux Builds / AppImage (push) Waiting to run
🐧 Linux Builds / Flatpak (push) Waiting to run
🍎 MacOS Builds / Defaults (push) Waiting to run
🖥️ Windows Builds / Lint VS Project Files (push) Waiting to run
🖥️ Windows Builds / SSE4 (push) Blocked by required conditions
🖥️ Windows Builds / AVX2 (push) Blocked by required conditions
🖥️ Windows Builds / CMake (push) Waiting to run
Some checks are pending
🐧 Linux Builds / AppImage (push) Waiting to run
🐧 Linux Builds / Flatpak (push) Waiting to run
🍎 MacOS Builds / Defaults (push) Waiting to run
🖥️ Windows Builds / Lint VS Project Files (push) Waiting to run
🖥️ Windows Builds / SSE4 (push) Blocked by required conditions
🖥️ Windows Builds / AVX2 (push) Blocked by required conditions
🖥️ Windows Builds / CMake (push) Waiting to run
This commit is contained in:
parent
7db487a49b
commit
cac6669423
@ -238,6 +238,12 @@ int DebuggerWindow::fontSize()
|
|||||||
|
|
||||||
void DebuggerWindow::updateTheme()
|
void DebuggerWindow::updateTheme()
|
||||||
{
|
{
|
||||||
|
// Detect recursive StyleChange events caused by updating the stylesheet.
|
||||||
|
if (m_is_updating_theme)
|
||||||
|
return;
|
||||||
|
|
||||||
|
m_is_updating_theme = true;
|
||||||
|
|
||||||
// TODO: Migrate away from stylesheets to improve performance.
|
// TODO: Migrate away from stylesheets to improve performance.
|
||||||
setStyleSheet(QString("font-size: %1pt;").arg(m_font_size));
|
setStyleSheet(QString("font-size: %1pt;").arg(m_font_size));
|
||||||
|
|
||||||
@ -248,6 +254,8 @@ void DebuggerWindow::updateTheme()
|
|||||||
setStyleSheet(QString());
|
setStyleSheet(QString());
|
||||||
|
|
||||||
dockManager().updateTheme();
|
dockManager().updateTheme();
|
||||||
|
|
||||||
|
m_is_updating_theme = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DebuggerWindow::saveWindowGeometry()
|
void DebuggerWindow::saveWindowGeometry()
|
||||||
@ -535,6 +543,12 @@ void DebuggerWindow::onStepOut()
|
|||||||
this->repaint();
|
this->repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DebuggerWindow::changeEvent(QEvent* event)
|
||||||
|
{
|
||||||
|
if (event->type() == QEvent::PaletteChange || event->type() == QEvent::StyleChange)
|
||||||
|
updateTheme();
|
||||||
|
}
|
||||||
|
|
||||||
void DebuggerWindow::closeEvent(QCloseEvent* event)
|
void DebuggerWindow::closeEvent(QCloseEvent* event)
|
||||||
{
|
{
|
||||||
dockManager().saveCurrentLayout();
|
dockManager().saveCurrentLayout();
|
||||||
|
|||||||
@ -60,7 +60,8 @@ Q_SIGNALS:
|
|||||||
void onVMActuallyPaused();
|
void onVMActuallyPaused();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void closeEvent(QCloseEvent* event);
|
void changeEvent(QEvent* event) override;
|
||||||
|
void closeEvent(QCloseEvent* event) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DebugInterface* currentCPU();
|
DebugInterface* currentCPU();
|
||||||
@ -75,6 +76,8 @@ private:
|
|||||||
int m_font_size;
|
int m_font_size;
|
||||||
static const constexpr int MINIMUM_FONT_SIZE = 5;
|
static const constexpr int MINIMUM_FONT_SIZE = 5;
|
||||||
static const constexpr int MAXIMUM_FONT_SIZE = 30;
|
static const constexpr int MAXIMUM_FONT_SIZE = 30;
|
||||||
|
|
||||||
|
bool m_is_updating_theme = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern DebuggerWindow* g_debugger_window;
|
extern DebuggerWindow* g_debugger_window;
|
||||||
|
|||||||
@ -1796,9 +1796,6 @@ void MainWindow::updateTheme()
|
|||||||
{
|
{
|
||||||
QtHost::UpdateApplicationTheme();
|
QtHost::UpdateApplicationTheme();
|
||||||
reloadThemeSpecificImages();
|
reloadThemeSpecificImages();
|
||||||
|
|
||||||
if (g_debugger_window)
|
|
||||||
g_debugger_window->updateTheme();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::reloadThemeSpecificImages()
|
void MainWindow::reloadThemeSpecificImages()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user