mirror of https://github.com/WerWolv/ImHex.git
ui: Improved byte selection text
This commit is contained in:
parent
3efdc02fed
commit
034cc0cd2f
|
@ -78,11 +78,16 @@ namespace hex {
|
|||
break;
|
||||
}
|
||||
|
||||
std::string result = hex::format("{0:.2f}", value);
|
||||
std::string result;
|
||||
|
||||
if (unitIndex == 0)
|
||||
result = hex::format("{0:}", value);
|
||||
else
|
||||
result = hex::format("{0:.2f}", value);
|
||||
|
||||
switch (unitIndex) {
|
||||
case 0:
|
||||
result += " Bytes";
|
||||
result += ((value == 1) ? " Byte" : " Bytes");
|
||||
break;
|
||||
case 1:
|
||||
result += " kB";
|
||||
|
|
|
@ -967,7 +967,7 @@ namespace hex::plugin::builtin {
|
|||
auto selection = this->getSelection();
|
||||
std::string value;
|
||||
if (this->isSelectionValid())
|
||||
value = hex::format("0x{0:08X} - 0x{1:08X} ({0} - {1}) ({2} {3})", selection.getStartAddress(), selection.getEndAddress(), selection.getSize(), selection.getSize() == 1 ? "Byte" : "Bytes");
|
||||
value = hex::format("0x{0:08X} - 0x{1:08X} ({2})", selection.getStartAddress(), selection.getEndAddress(), hex::toByteString(selection.getSize()));
|
||||
else
|
||||
value = std::string("hex.builtin.view.hex_editor.selection.none"_lang);
|
||||
|
||||
|
|
Loading…
Reference in New Issue