New setting in the hex viewer for toggling the display of annotations

This commit is contained in:
Nav
2021-12-25 22:52:34 +00:00
parent fef3aac3ae
commit cc51e1b4c8
2 changed files with 7 additions and 3 deletions

View File

@@ -166,7 +166,10 @@ void ByteItemGraphicsScene::adjustSize(bool forced) {
if (!this->byteItemsByAddress.empty()) {
this->adjustByteItemPositions();
this->adjustAnnotationItemPositions();
if (this->settings.displayAnnotations) {
this->adjustAnnotationItemPositions();
}
const auto* lastByteItem = (--this->byteItemsByAddress.end())->second;
const auto sceneHeight = static_cast<int>(
@@ -293,7 +296,7 @@ void ByteItemGraphicsScene::adjustByteItemPositions() {
);
// We only display annotations that span a single row.
if (firstByteRowIndex == lastByteRowIndex) {
if (this->settings.displayAnnotations && firstByteRowIndex == lastByteRowIndex) {
annotationItem->show();
if (annotationItem->position == AnnotationItemPosition::TOP) {
@@ -360,7 +363,7 @@ void ByteItemGraphicsScene::adjustByteItemPositions() {
}
void ByteItemGraphicsScene::adjustAnnotationItemPositions() {
if (this->byteItemsByAddress.empty()) {
if (this->byteItemsByAddress.empty() || !this->settings.displayAnnotations) {
return;
}

View File

@@ -8,5 +8,6 @@ namespace Bloom::Widgets
bool highlightFocusedMemory = true;
bool highlightHoveredRowAndCol = true;
bool displayAsciiValues = false;
bool displayAnnotations = true;
};
}