Moved ownership of hex viewer settings to TargetMemoryInspectionPane and corrected default settings

This commit is contained in:
Nav
2021-12-25 22:16:28 +00:00
parent cacd81b1dc
commit fef3aac3ae
4 changed files with 11 additions and 7 deletions

View File

@@ -12,6 +12,7 @@ using Bloom::Targets::TargetMemoryDescriptor;
HexViewerWidget::HexViewerWidget(
const TargetMemoryDescriptor& targetMemoryDescriptor,
HexViewerWidgetSettings& settings,
std::vector<FocusedMemoryRegion>& focusedMemoryRegions,
std::vector<ExcludedMemoryRegion>& excludedMemoryRegions,
InsightWorker& insightWorker,
@@ -19,6 +20,7 @@ HexViewerWidget::HexViewerWidget(
):
QWidget(parent),
targetMemoryDescriptor(targetMemoryDescriptor),
settings(settings),
focusedMemoryRegions(focusedMemoryRegions),
excludedMemoryRegions(excludedMemoryRegions),
insightWorker(insightWorker)
@@ -74,9 +76,9 @@ HexViewerWidget::HexViewerWidget(
);
this->byteItemGraphicsScene = this->byteItemGraphicsView->getScene();
this->setStackMemoryHighlightingEnabled(true);
this->setHoveredRowAndColumnHighlightingEnabled(true);
this->setFocusedMemoryHighlightingEnabled(true);
this->setStackMemoryHighlightingEnabled(this->settings.highlightStackMemory);
this->setHoveredRowAndColumnHighlightingEnabled(this->settings.highlightHoveredRowAndCol);
this->setFocusedMemoryHighlightingEnabled(this->settings.highlightFocusedMemory);
QObject::connect(
this->highlightStackMemoryButton,

View File

@@ -31,6 +31,7 @@ namespace Bloom::Widgets
HexViewerWidget(
const Targets::TargetMemoryDescriptor& targetMemoryDescriptor,
HexViewerWidgetSettings& settings,
std::vector<FocusedMemoryRegion>& focusedMemoryRegions,
std::vector<ExcludedMemoryRegion>& excludedMemoryRegions,
InsightWorker& insightWorker,
@@ -52,7 +53,7 @@ namespace Bloom::Widgets
InsightWorker& insightWorker;
HexViewerWidgetSettings settings = HexViewerWidgetSettings();
HexViewerWidgetSettings& settings;
QWidget* container = nullptr;
QWidget* toolBar = nullptr;

View File

@@ -4,9 +4,9 @@ namespace Bloom::Widgets
{
struct HexViewerWidgetSettings
{
bool highlightStackMemory = false;
bool highlightFocusedMemory = false;
bool highlightHoveredRowAndCol = false;
bool highlightStackMemory = true;
bool highlightFocusedMemory = true;
bool highlightHoveredRowAndCol = true;
bool displayAsciiValues = false;
};
}

View File

@@ -61,6 +61,7 @@ TargetMemoryInspectionPane::TargetMemoryInspectionPane(
this->manageMemoryRegionsButton = this->container->findChild<SvgToolButton*>("manage-memory-regions-btn");
this->hexViewerWidget = new HexViewerWidget(
this->targetMemoryDescriptor,
this->settings.hexViewerWidgetSettings,
this->settings.focusedMemoryRegions,
this->settings.excludedMemoryRegions,
this->insightWorker,