Hide stack memory highlighting option for non RAM inspection panes

This commit is contained in:
Nav
2021-12-25 23:08:59 +00:00
parent 2c54457e0f
commit f47c1c6a60
2 changed files with 24 additions and 9 deletions

View File

@@ -77,19 +77,27 @@ HexViewerWidget::HexViewerWidget(
); );
this->byteItemGraphicsScene = this->byteItemGraphicsView->getScene(); this->byteItemGraphicsScene = this->byteItemGraphicsView->getScene();
this->setStackMemoryHighlightingEnabled(this->settings.highlightStackMemory);
this->setHoveredRowAndColumnHighlightingEnabled(this->settings.highlightHoveredRowAndCol); this->setHoveredRowAndColumnHighlightingEnabled(this->settings.highlightHoveredRowAndCol);
this->setFocusedMemoryHighlightingEnabled(this->settings.highlightFocusedMemory); this->setFocusedMemoryHighlightingEnabled(this->settings.highlightFocusedMemory);
this->setAnnotationsEnabled(this->settings.displayAnnotations); this->setAnnotationsEnabled(this->settings.displayAnnotations);
QObject::connect( if (this->targetMemoryDescriptor.type == Targets::TargetMemoryType::RAM) {
this->highlightStackMemoryButton, this->highlightStackMemoryButton->show();
&QToolButton::clicked, this->setStackMemoryHighlightingEnabled(this->settings.highlightStackMemory);
this,
[this] { QObject::connect(
this->setStackMemoryHighlightingEnabled(!this->settings.highlightStackMemory); this->highlightStackMemoryButton,
} &QToolButton::clicked,
); this,
[this] {
this->setStackMemoryHighlightingEnabled(!this->settings.highlightStackMemory);
}
);
} else {
this->highlightStackMemoryButton->hide();
this->setStackMemoryHighlightingEnabled(false);
}
QObject::connect( QObject::connect(
this->highlightHoveredRowAndColumnButton, this->highlightHoveredRowAndColumnButton,

View File

@@ -59,6 +59,13 @@
</item> </item>
<item> <item>
<widget class="SvgToolButton" name="highlight-stack-memory-btn"> <widget class="SvgToolButton" name="highlight-stack-memory-btn">
<!--
This button is hidden by default. Only to be displayed for the RAM inspection pane.
-->
<property name="visible">
<bool>false</bool>
</property>
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>
</property> </property>