mirror of https://github.com/WerWolv/ImHex.git
impr: Fade out zero bytes in HTML formatted data
This commit is contained in:
parent
a64aa6941d
commit
0f5d659ce2
|
@ -157,6 +157,7 @@ namespace hex::plugin::builtin {
|
||||||
" .offsetcolumn { color:#0000A0 }\n"
|
" .offsetcolumn { color:#0000A0 }\n"
|
||||||
" .hexcolumn { color:#000000 }\n"
|
" .hexcolumn { color:#000000 }\n"
|
||||||
" .textcolumn { color:#000000 }\n"
|
" .textcolumn { color:#000000 }\n"
|
||||||
|
" .zerobyte { color:#808080 }\n"
|
||||||
" </style>\n\n"
|
" </style>\n\n"
|
||||||
" <code>\n"
|
" <code>\n"
|
||||||
" <span class=\"offsetheader\">Hex View  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F</span>";
|
" <span class=\"offsetheader\">Hex View  00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F</span>";
|
||||||
|
@ -185,7 +186,13 @@ namespace hex::plugin::builtin {
|
||||||
result += "</span>";
|
result += "</span>";
|
||||||
}
|
}
|
||||||
|
|
||||||
result += hex::format("{0:02X} ", byte);
|
std::string tagStart, tagEnd;
|
||||||
|
if (byte == 0x00) {
|
||||||
|
tagStart = "<span class=\"zerobyte\">";
|
||||||
|
tagEnd = "</span>";
|
||||||
|
}
|
||||||
|
|
||||||
|
result += hex::format("{0}{2:02X}{1} ", tagStart, tagEnd, byte);
|
||||||
asciiRow += std::isprint(byte) ? char(byte) : '.';
|
asciiRow += std::isprint(byte) ? char(byte) : '.';
|
||||||
if ((address % 0x10) == 0x07)
|
if ((address % 0x10) == 0x07)
|
||||||
result += " ";
|
result += " ";
|
||||||
|
@ -193,8 +200,9 @@ namespace hex::plugin::builtin {
|
||||||
address++;
|
address++;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (u32 i = 0; i < (0x10 - (address % 0x10)); i++)
|
if (address % 0x10 != 0x00)
|
||||||
result += "   ";
|
for (u32 i = 0; i < (0x10 - (address % 0x10)); i++)
|
||||||
|
result += "   ";
|
||||||
result += asciiRow;
|
result += asciiRow;
|
||||||
|
|
||||||
result +=
|
result +=
|
||||||
|
|
Loading…
Reference in New Issue