Merge pull request #7833 from chargeflux/CodeWidgetHiding-macOS

Debugger: Apply hiding logic earlier (macOS)
This commit is contained in:
spycrab 2019-04-23 22:40:17 +02:00 committed by GitHub
commit 8e3d1200da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 27 additions and 14 deletions

View File

@ -26,11 +26,16 @@ BreakpointWidget::BreakpointWidget(QWidget* parent) : QDockWidget(parent)
setWindowTitle(tr("Breakpoints"));
setObjectName(QStringLiteral("breakpoints"));
setHidden(!Settings::Instance().IsBreakpointsVisible() ||
!Settings::Instance().IsDebugModeEnabled());
setAllowedAreas(Qt::AllDockWidgetAreas);
auto& settings = Settings::GetQSettings();
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());
CreateWidgets();
@ -61,9 +66,6 @@ BreakpointWidget::BreakpointWidget(QWidget* parent) : QDockWidget(parent)
connect(&Settings::Instance(), &Settings::ThemeChanged, this, &BreakpointWidget::UpdateIcons);
UpdateIcons();
setHidden(!Settings::Instance().IsBreakpointsVisible() ||
!Settings::Instance().IsDebugModeEnabled());
Update();
}

View File

@ -30,11 +30,15 @@ CodeWidget::CodeWidget(QWidget* parent) : QDockWidget(parent)
setWindowTitle(tr("Code"));
setObjectName(QStringLiteral("code"));
setHidden(!Settings::Instance().IsCodeVisible() || !Settings::Instance().IsDebugModeEnabled());
setAllowedAreas(Qt::AllDockWidgetAreas);
auto& settings = Settings::GetQSettings();
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());
connect(&Settings::Instance(), &Settings::CodeVisibilityChanged,
@ -53,8 +57,6 @@ CodeWidget::CodeWidget(QWidget* parent) : QDockWidget(parent)
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, &CodeWidget::Update);
setHidden(!Settings::Instance().IsCodeVisible() || !Settings::Instance().IsDebugModeEnabled());
CreateWidgets();
ConnectWidgets();

View File

@ -22,6 +22,8 @@ JITWidget::JITWidget(QWidget* parent) : QDockWidget(parent)
setWindowTitle(tr("JIT Blocks"));
setObjectName(QStringLiteral("jitwidget"));
setHidden(!Settings::Instance().IsJITVisible() || !Settings::Instance().IsDebugModeEnabled());
setAllowedAreas(Qt::AllDockWidgetAreas);
auto& settings = Settings::GetQSettings();
@ -29,6 +31,8 @@ JITWidget::JITWidget(QWidget* parent) : QDockWidget(parent)
CreateWidgets();
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());
m_table_splitter->restoreState(
@ -44,8 +48,6 @@ JITWidget::JITWidget(QWidget* parent) : QDockWidget(parent)
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, &JITWidget::Update);
setHidden(!Settings::Instance().IsJITVisible() || !Settings::Instance().IsDebugModeEnabled());
ConnectWidgets();
#if defined(_M_X86)

View File

@ -34,6 +34,8 @@ MemoryWidget::MemoryWidget(QWidget* parent) : QDockWidget(parent)
setWindowTitle(tr("Memory"));
setObjectName(QStringLiteral("memory"));
setHidden(!Settings::Instance().IsMemoryVisible() || !Settings::Instance().IsDebugModeEnabled());
setAllowedAreas(Qt::AllDockWidgetAreas);
CreateWidgets();
@ -41,6 +43,8 @@ MemoryWidget::MemoryWidget(QWidget* parent) : QDockWidget(parent)
QSettings& settings = Settings::GetQSettings();
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());
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);
setHidden(!Settings::Instance().IsCodeVisible() || !Settings::Instance().IsDebugModeEnabled());
LoadSettings();
ConnectWidgets();

View File

@ -21,11 +21,17 @@ RegisterWidget::RegisterWidget(QWidget* parent) : QDockWidget(parent)
{
setWindowTitle(tr("Registers"));
setObjectName(QStringLiteral("registers"));
setHidden(!Settings::Instance().IsRegistersVisible() ||
!Settings::Instance().IsDebugModeEnabled());
setAllowedAreas(Qt::AllDockWidgetAreas);
auto& settings = Settings::GetQSettings();
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());
CreateWidgets();
@ -47,9 +53,6 @@ RegisterWidget::RegisterWidget(QWidget* parent) : QDockWidget(parent)
connect(&Settings::Instance(), &Settings::DebugModeToggled, [this](bool enabled) {
setHidden(!enabled || !Settings::Instance().IsRegistersVisible());
});
setHidden(!Settings::Instance().IsRegistersVisible() ||
!Settings::Instance().IsDebugModeEnabled());
}
RegisterWidget::~RegisterWidget()

View File

@ -28,11 +28,15 @@ WatchWidget::WatchWidget(QWidget* parent) : QDockWidget(parent)
setWindowTitle(tr("Watch"));
setObjectName(QStringLiteral("watch"));
setHidden(!Settings::Instance().IsWatchVisible() || !Settings::Instance().IsDebugModeEnabled());
setAllowedAreas(Qt::AllDockWidgetAreas);
auto& settings = Settings::GetQSettings();
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());
CreateWidgets();
@ -58,8 +62,6 @@ WatchWidget::WatchWidget(QWidget* parent) : QDockWidget(parent)
connect(&Settings::Instance(), &Settings::ThemeChanged, this, &WatchWidget::UpdateIcons);
UpdateIcons();
setHidden(!Settings::Instance().IsWatchVisible() || !Settings::Instance().IsDebugModeEnabled());
Update();
}