Merge pull request #7833 from chargeflux/CodeWidgetHiding-macOS
Debugger: Apply hiding logic earlier (macOS)
This commit is contained in:
commit
8e3d1200da
|
@ -26,11 +26,16 @@ BreakpointWidget::BreakpointWidget(QWidget* parent) : QDockWidget(parent)
|
||||||
setWindowTitle(tr("Breakpoints"));
|
setWindowTitle(tr("Breakpoints"));
|
||||||
setObjectName(QStringLiteral("breakpoints"));
|
setObjectName(QStringLiteral("breakpoints"));
|
||||||
|
|
||||||
|
setHidden(!Settings::Instance().IsBreakpointsVisible() ||
|
||||||
|
!Settings::Instance().IsDebugModeEnabled());
|
||||||
|
|
||||||
setAllowedAreas(Qt::AllDockWidgetAreas);
|
setAllowedAreas(Qt::AllDockWidgetAreas);
|
||||||
|
|
||||||
auto& settings = Settings::GetQSettings();
|
auto& settings = Settings::GetQSettings();
|
||||||
|
|
||||||
restoreGeometry(settings.value(QStringLiteral("breakpointwidget/geometry")).toByteArray());
|
restoreGeometry(settings.value(QStringLiteral("breakpointwidget/geometry")).toByteArray());
|
||||||
|
// macOS: setHidden() needs to be evaluated before setFloating() for proper window presentation
|
||||||
|
// according to Settings
|
||||||
setFloating(settings.value(QStringLiteral("breakpointwidget/floating")).toBool());
|
setFloating(settings.value(QStringLiteral("breakpointwidget/floating")).toBool());
|
||||||
|
|
||||||
CreateWidgets();
|
CreateWidgets();
|
||||||
|
@ -61,9 +66,6 @@ BreakpointWidget::BreakpointWidget(QWidget* parent) : QDockWidget(parent)
|
||||||
connect(&Settings::Instance(), &Settings::ThemeChanged, this, &BreakpointWidget::UpdateIcons);
|
connect(&Settings::Instance(), &Settings::ThemeChanged, this, &BreakpointWidget::UpdateIcons);
|
||||||
UpdateIcons();
|
UpdateIcons();
|
||||||
|
|
||||||
setHidden(!Settings::Instance().IsBreakpointsVisible() ||
|
|
||||||
!Settings::Instance().IsDebugModeEnabled());
|
|
||||||
|
|
||||||
Update();
|
Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,11 +30,15 @@ CodeWidget::CodeWidget(QWidget* parent) : QDockWidget(parent)
|
||||||
setWindowTitle(tr("Code"));
|
setWindowTitle(tr("Code"));
|
||||||
setObjectName(QStringLiteral("code"));
|
setObjectName(QStringLiteral("code"));
|
||||||
|
|
||||||
|
setHidden(!Settings::Instance().IsCodeVisible() || !Settings::Instance().IsDebugModeEnabled());
|
||||||
|
|
||||||
setAllowedAreas(Qt::AllDockWidgetAreas);
|
setAllowedAreas(Qt::AllDockWidgetAreas);
|
||||||
|
|
||||||
auto& settings = Settings::GetQSettings();
|
auto& settings = Settings::GetQSettings();
|
||||||
|
|
||||||
restoreGeometry(settings.value(QStringLiteral("codewidget/geometry")).toByteArray());
|
restoreGeometry(settings.value(QStringLiteral("codewidget/geometry")).toByteArray());
|
||||||
|
// macOS: setHidden() needs to be evaluated before setFloating() for proper window presentation
|
||||||
|
// according to Settings
|
||||||
setFloating(settings.value(QStringLiteral("codewidget/floating")).toBool());
|
setFloating(settings.value(QStringLiteral("codewidget/floating")).toBool());
|
||||||
|
|
||||||
connect(&Settings::Instance(), &Settings::CodeVisibilityChanged,
|
connect(&Settings::Instance(), &Settings::CodeVisibilityChanged,
|
||||||
|
@ -53,8 +57,6 @@ CodeWidget::CodeWidget(QWidget* parent) : QDockWidget(parent)
|
||||||
|
|
||||||
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, &CodeWidget::Update);
|
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, &CodeWidget::Update);
|
||||||
|
|
||||||
setHidden(!Settings::Instance().IsCodeVisible() || !Settings::Instance().IsDebugModeEnabled());
|
|
||||||
|
|
||||||
CreateWidgets();
|
CreateWidgets();
|
||||||
ConnectWidgets();
|
ConnectWidgets();
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,8 @@ JITWidget::JITWidget(QWidget* parent) : QDockWidget(parent)
|
||||||
setWindowTitle(tr("JIT Blocks"));
|
setWindowTitle(tr("JIT Blocks"));
|
||||||
setObjectName(QStringLiteral("jitwidget"));
|
setObjectName(QStringLiteral("jitwidget"));
|
||||||
|
|
||||||
|
setHidden(!Settings::Instance().IsJITVisible() || !Settings::Instance().IsDebugModeEnabled());
|
||||||
|
|
||||||
setAllowedAreas(Qt::AllDockWidgetAreas);
|
setAllowedAreas(Qt::AllDockWidgetAreas);
|
||||||
|
|
||||||
auto& settings = Settings::GetQSettings();
|
auto& settings = Settings::GetQSettings();
|
||||||
|
@ -29,6 +31,8 @@ JITWidget::JITWidget(QWidget* parent) : QDockWidget(parent)
|
||||||
CreateWidgets();
|
CreateWidgets();
|
||||||
|
|
||||||
restoreGeometry(settings.value(QStringLiteral("jitwidget/geometry")).toByteArray());
|
restoreGeometry(settings.value(QStringLiteral("jitwidget/geometry")).toByteArray());
|
||||||
|
// macOS: setHidden() needs to be evaluated before setFloating() for proper window presentation
|
||||||
|
// according to Settings
|
||||||
setFloating(settings.value(QStringLiteral("jitwidget/floating")).toBool());
|
setFloating(settings.value(QStringLiteral("jitwidget/floating")).toBool());
|
||||||
|
|
||||||
m_table_splitter->restoreState(
|
m_table_splitter->restoreState(
|
||||||
|
@ -44,8 +48,6 @@ JITWidget::JITWidget(QWidget* parent) : QDockWidget(parent)
|
||||||
|
|
||||||
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, &JITWidget::Update);
|
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, &JITWidget::Update);
|
||||||
|
|
||||||
setHidden(!Settings::Instance().IsJITVisible() || !Settings::Instance().IsDebugModeEnabled());
|
|
||||||
|
|
||||||
ConnectWidgets();
|
ConnectWidgets();
|
||||||
|
|
||||||
#if defined(_M_X86)
|
#if defined(_M_X86)
|
||||||
|
|
|
@ -34,6 +34,8 @@ MemoryWidget::MemoryWidget(QWidget* parent) : QDockWidget(parent)
|
||||||
setWindowTitle(tr("Memory"));
|
setWindowTitle(tr("Memory"));
|
||||||
setObjectName(QStringLiteral("memory"));
|
setObjectName(QStringLiteral("memory"));
|
||||||
|
|
||||||
|
setHidden(!Settings::Instance().IsMemoryVisible() || !Settings::Instance().IsDebugModeEnabled());
|
||||||
|
|
||||||
setAllowedAreas(Qt::AllDockWidgetAreas);
|
setAllowedAreas(Qt::AllDockWidgetAreas);
|
||||||
|
|
||||||
CreateWidgets();
|
CreateWidgets();
|
||||||
|
@ -41,6 +43,8 @@ MemoryWidget::MemoryWidget(QWidget* parent) : QDockWidget(parent)
|
||||||
QSettings& settings = Settings::GetQSettings();
|
QSettings& settings = Settings::GetQSettings();
|
||||||
|
|
||||||
restoreGeometry(settings.value(QStringLiteral("memorywidget/geometry")).toByteArray());
|
restoreGeometry(settings.value(QStringLiteral("memorywidget/geometry")).toByteArray());
|
||||||
|
// macOS: setHidden() needs to be evaluated before setFloating() for proper window presentation
|
||||||
|
// according to Settings
|
||||||
setFloating(settings.value(QStringLiteral("memorywidget/floating")).toBool());
|
setFloating(settings.value(QStringLiteral("memorywidget/floating")).toBool());
|
||||||
m_splitter->restoreState(settings.value(QStringLiteral("codewidget/splitter")).toByteArray());
|
m_splitter->restoreState(settings.value(QStringLiteral("codewidget/splitter")).toByteArray());
|
||||||
|
|
||||||
|
@ -52,8 +56,6 @@ MemoryWidget::MemoryWidget(QWidget* parent) : QDockWidget(parent)
|
||||||
|
|
||||||
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, &MemoryWidget::Update);
|
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, &MemoryWidget::Update);
|
||||||
|
|
||||||
setHidden(!Settings::Instance().IsCodeVisible() || !Settings::Instance().IsDebugModeEnabled());
|
|
||||||
|
|
||||||
LoadSettings();
|
LoadSettings();
|
||||||
|
|
||||||
ConnectWidgets();
|
ConnectWidgets();
|
||||||
|
|
|
@ -21,11 +21,17 @@ RegisterWidget::RegisterWidget(QWidget* parent) : QDockWidget(parent)
|
||||||
{
|
{
|
||||||
setWindowTitle(tr("Registers"));
|
setWindowTitle(tr("Registers"));
|
||||||
setObjectName(QStringLiteral("registers"));
|
setObjectName(QStringLiteral("registers"));
|
||||||
|
|
||||||
|
setHidden(!Settings::Instance().IsRegistersVisible() ||
|
||||||
|
!Settings::Instance().IsDebugModeEnabled());
|
||||||
|
|
||||||
setAllowedAreas(Qt::AllDockWidgetAreas);
|
setAllowedAreas(Qt::AllDockWidgetAreas);
|
||||||
|
|
||||||
auto& settings = Settings::GetQSettings();
|
auto& settings = Settings::GetQSettings();
|
||||||
|
|
||||||
restoreGeometry(settings.value(QStringLiteral("registerwidget/geometry")).toByteArray());
|
restoreGeometry(settings.value(QStringLiteral("registerwidget/geometry")).toByteArray());
|
||||||
|
// macOS: setHidden() needs to be evaluated before setFloating() for proper window presentation
|
||||||
|
// according to Settings
|
||||||
setFloating(settings.value(QStringLiteral("registerwidget/floating")).toBool());
|
setFloating(settings.value(QStringLiteral("registerwidget/floating")).toBool());
|
||||||
|
|
||||||
CreateWidgets();
|
CreateWidgets();
|
||||||
|
@ -47,9 +53,6 @@ RegisterWidget::RegisterWidget(QWidget* parent) : QDockWidget(parent)
|
||||||
connect(&Settings::Instance(), &Settings::DebugModeToggled, [this](bool enabled) {
|
connect(&Settings::Instance(), &Settings::DebugModeToggled, [this](bool enabled) {
|
||||||
setHidden(!enabled || !Settings::Instance().IsRegistersVisible());
|
setHidden(!enabled || !Settings::Instance().IsRegistersVisible());
|
||||||
});
|
});
|
||||||
|
|
||||||
setHidden(!Settings::Instance().IsRegistersVisible() ||
|
|
||||||
!Settings::Instance().IsDebugModeEnabled());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RegisterWidget::~RegisterWidget()
|
RegisterWidget::~RegisterWidget()
|
||||||
|
|
|
@ -28,11 +28,15 @@ WatchWidget::WatchWidget(QWidget* parent) : QDockWidget(parent)
|
||||||
setWindowTitle(tr("Watch"));
|
setWindowTitle(tr("Watch"));
|
||||||
setObjectName(QStringLiteral("watch"));
|
setObjectName(QStringLiteral("watch"));
|
||||||
|
|
||||||
|
setHidden(!Settings::Instance().IsWatchVisible() || !Settings::Instance().IsDebugModeEnabled());
|
||||||
|
|
||||||
setAllowedAreas(Qt::AllDockWidgetAreas);
|
setAllowedAreas(Qt::AllDockWidgetAreas);
|
||||||
|
|
||||||
auto& settings = Settings::GetQSettings();
|
auto& settings = Settings::GetQSettings();
|
||||||
|
|
||||||
restoreGeometry(settings.value(QStringLiteral("watchwidget/geometry")).toByteArray());
|
restoreGeometry(settings.value(QStringLiteral("watchwidget/geometry")).toByteArray());
|
||||||
|
// macOS: setHidden() needs to be evaluated before setFloating() for proper window presentation
|
||||||
|
// according to Settings
|
||||||
setFloating(settings.value(QStringLiteral("watchwidget/floating")).toBool());
|
setFloating(settings.value(QStringLiteral("watchwidget/floating")).toBool());
|
||||||
|
|
||||||
CreateWidgets();
|
CreateWidgets();
|
||||||
|
@ -58,8 +62,6 @@ WatchWidget::WatchWidget(QWidget* parent) : QDockWidget(parent)
|
||||||
connect(&Settings::Instance(), &Settings::ThemeChanged, this, &WatchWidget::UpdateIcons);
|
connect(&Settings::Instance(), &Settings::ThemeChanged, this, &WatchWidget::UpdateIcons);
|
||||||
UpdateIcons();
|
UpdateIcons();
|
||||||
|
|
||||||
setHidden(!Settings::Instance().IsWatchVisible() || !Settings::Instance().IsDebugModeEnabled());
|
|
||||||
|
|
||||||
Update();
|
Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue