diff --git a/src/Insight/UserInterfaces/InsightWindow/Stylesheets/InsightWindow.qss b/src/Insight/UserInterfaces/InsightWindow/Stylesheets/InsightWindow.qss index 46ac08c1..2bfc196a 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Stylesheets/InsightWindow.qss +++ b/src/Insight/UserInterfaces/InsightWindow/Stylesheets/InsightWindow.qss @@ -414,7 +414,8 @@ QScrollBar::sub-line:vertical { #hex-viewer-container #tool-bar #highlight-stack-memory-btn, #hex-viewer-container #tool-bar #highlight-focused-memory-btn, -#hex-viewer-container #tool-bar #highlight-hovered-rows-columns-btn { +#hex-viewer-container #tool-bar #highlight-hovered-rows-columns-btn, +#hex-viewer-container #tool-bar #display-annotations-btn { qproperty-buttonWidth: 25; qproperty-buttonHeight: 21; } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp index ac0a855e..1d018b1c 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.cpp @@ -55,6 +55,7 @@ HexViewerWidget::HexViewerWidget( this->highlightFocusedMemoryButton = this->container->findChild( "highlight-focused-memory-btn" ); + this->displayAnnotationsButton = this->container->findChild("display-annotations-btn"); this->toolBar->setContentsMargins(0, 0, 0, 0); this->toolBar->layout()->setContentsMargins(5, 0, 5, 1); @@ -79,6 +80,7 @@ HexViewerWidget::HexViewerWidget( this->setStackMemoryHighlightingEnabled(this->settings.highlightStackMemory); this->setHoveredRowAndColumnHighlightingEnabled(this->settings.highlightHoveredRowAndCol); this->setFocusedMemoryHighlightingEnabled(this->settings.highlightFocusedMemory); + this->setAnnotationsEnabled(this->settings.displayAnnotations); QObject::connect( this->highlightStackMemoryButton, @@ -107,6 +109,15 @@ HexViewerWidget::HexViewerWidget( } ); + QObject::connect( + this->displayAnnotationsButton, + &QToolButton::clicked, + this, + [this] { + this->setAnnotationsEnabled(!this->settings.displayAnnotations); + } + ); + QObject::connect( &insightWorker, &InsightWorker::targetStateUpdated, @@ -167,3 +178,10 @@ void HexViewerWidget::setFocusedMemoryHighlightingEnabled(bool enabled) { this->byteItemGraphicsScene->invalidateChildItemCaches(); } + +void HexViewerWidget::setAnnotationsEnabled(bool enabled) { + this->displayAnnotationsButton->setChecked(enabled); + this->settings.displayAnnotations = enabled; + + this->byteItemGraphicsScene->adjustSize(true); +} diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp index 463e4613..435e4217 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/HexViewerWidget.hpp @@ -67,6 +67,7 @@ namespace Bloom::Widgets SvgToolButton* highlightStackMemoryButton = nullptr; SvgToolButton* highlightFocusedMemoryButton = nullptr; SvgToolButton* highlightHoveredRowAndColumnButton = nullptr; + SvgToolButton* displayAnnotationsButton = nullptr; Targets::TargetState targetState = Targets::TargetState::UNKNOWN; @@ -74,5 +75,6 @@ namespace Bloom::Widgets void setStackMemoryHighlightingEnabled(bool enabled); void setHoveredRowAndColumnHighlightingEnabled(bool enabled); void setFocusedMemoryHighlightingEnabled(bool enabled); + void setAnnotationsEnabled(bool enabled); }; } diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/display-annotations-disabled.svg b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/display-annotations-disabled.svg new file mode 100644 index 00000000..0037d538 --- /dev/null +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/display-annotations-disabled.svg @@ -0,0 +1,139 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/display-annotations.svg b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/display-annotations.svg new file mode 100644 index 00000000..c9a1818c --- /dev/null +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/display-annotations.svg @@ -0,0 +1,139 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + 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 de8494d8..7c1cfbc5 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/UiFiles/HexViewerWidget.ui +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/UiFiles/HexViewerWidget.ui @@ -105,6 +105,22 @@ + + + + true + + + :/compiled/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/display-annotations.svg + + + :/compiled/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/display-annotations-disabled.svg + + + Display Annotations + + + @@ -160,13 +176,6 @@ - - - - - - - diff --git a/src/resources.qrc b/src/resources.qrc index 310e8787..bb3c7b07 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -45,6 +45,8 @@ ./Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/Images/manage-focused-regions.svg ./Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/highlight-hovered-rows-columns.svg ./Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/highlight-hovered-rows-columns-disabled.svg + ./Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/display-annotations.svg + ./Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/HexViewerWidget/Images/display-annotations-disabled.svg ./Insight/UserInterfaces/InsightWindow/Widgets/TargetWidgets/DIP/Stylesheets/DualInlinePackage.qss