Skip to content
Permalink
Browse files

Merge pull request #7833 from chargeflux/CodeWidgetHiding-macOS

Debugger: Apply hiding logic earlier (macOS)
  • Loading branch information...
spycrab committed Apr 23, 2019
2 parents 2abe333 + 290275e commit 8e3d1200daac9688d0d7c599bcd90a300e89aad0
@@ -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();
}

@@ -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();

@@ -22,13 +22,17 @@ 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();

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)
@@ -34,13 +34,17 @@ MemoryWidget::MemoryWidget(QWidget* parent) : QDockWidget(parent)
setWindowTitle(tr("Memory"));
setObjectName(QStringLiteral("memory"));

setHidden(!Settings::Instance().IsMemoryVisible() || !Settings::Instance().IsDebugModeEnabled());

setAllowedAreas(Qt::AllDockWidgetAreas);

CreateWidgets();

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();
@@ -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()
@@ -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();
}

0 comments on commit 8e3d120

Please sign in to comment.
You can’t perform that action at this time.