Disable align to 0 of HexdumpWidget, highlight current seek (FIX #64) (#492)

* Disable align to 0 of HexdumpWidget, highlight current seek

Disabled the alginment to `0x???????0` and made the current seek the first column.
Added color to highlight the current seek address.

* fixed camelCase

* Fixed camelCase#2
This commit is contained in:
Itay Cohen 2018-05-13 17:43:38 +03:00 committed by xarkes
parent 21400952f2
commit fad76ecddb

View File

@ -289,9 +289,6 @@ void HexdumpWidget::refresh(RVA addr)
if (cols == 0) if (cols == 0)
cols = 16; cols = 16;
// Align addr to cols
addr -= addr % cols;
// TODO: Figure out how to calculate a sane value for this // TODO: Figure out how to calculate a sane value for this
bufferLines = qhelpers::getMaxFullyDisplayedLines(ui->hexHexText); bufferLines = qhelpers::getMaxFullyDisplayedLines(ui->hexHexText);
@ -321,6 +318,12 @@ void HexdumpWidget::refresh(RVA addr)
ui->hexHexText->setTextCursor(cursor); ui->hexHexText->setTextCursor(cursor);
ui->hexHexText->ensureCursorVisible(); ui->hexHexText->ensureCursorVisible();
// Set the backgorund color of the current seek
QTextCursor offsetCursor(ui->hexOffsetText->document()->findBlockByLineNumber(curAddrLineOffset));
QTextBlockFormat formatTmp = offsetCursor.blockFormat();
formatTmp.setBackground(QColor(64, 129, 160));
offsetCursor.setBlockFormat(formatTmp);
updateWidths(); updateWidths();
// Update other text areas scroll // Update other text areas scroll