From f47c1c6a600dba0575225717bcc5282d1c9de301 Mon Sep 17 00:00:00 2001 From: Nav Date: Sat, 25 Dec 2021 23:08:59 +0000 Subject: [PATCH] Hide stack memory highlighting option for non RAM inspection panes --- .../HexViewerWidget/HexViewerWidget.cpp | 26 ++++++++++++------- .../UiFiles/HexViewerWidget.ui | 7 +++++ 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp index 1d018b1c..9798473c 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp @@ -77,19 +77,27 @@ HexViewerWidget::HexViewerWidget( ); this->byteItemGraphicsScene = this->byteItemGraphicsView->getScene(); - this->setStackMemoryHighlightingEnabled(this->settings.highlightStackMemory); this->setHoveredRowAndColumnHighlightingEnabled(this->settings.highlightHoveredRowAndCol); this->setFocusedMemoryHighlightingEnabled(this->settings.highlightFocusedMemory); this->setAnnotationsEnabled(this->settings.displayAnnotations); - QObject::connect( - this->highlightStackMemoryButton, - &QToolButton::clicked, - this, - [this] { - this->setStackMemoryHighlightingEnabled(!this->settings.highlightStackMemory); - } - ); + if (this->targetMemoryDescriptor.type == Targets::TargetMemoryType::RAM) { + this->highlightStackMemoryButton->show(); + this->setStackMemoryHighlightingEnabled(this->settings.highlightStackMemory); + + QObject::connect( + this->highlightStackMemoryButton, + &QToolButton::clicked, + this, + [this] { + this->setStackMemoryHighlightingEnabled(!this->settings.highlightStackMemory); + } + ); + + } else { + this->highlightStackMemoryButton->hide(); + this->setStackMemoryHighlightingEnabled(false); + } QObject::connect( this->highlightHoveredRowAndColumnButton, diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/UiFiles/HexViewerWidget.ui b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/UiFiles/HexViewerWidget.ui index 7c1cfbc5..303fd7ad 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/UiFiles/HexViewerWidget.ui +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/UiFiles/HexViewerWidget.ui @@ -59,6 +59,13 @@ + + + false + + true