ui: Improved byte selection text
This commit is contained in:
parent
3efdc02fed
commit
034cc0cd2f
@ -78,11 +78,16 @@ namespace hex {
|
|||||||
break;
|
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) {
|
switch (unitIndex) {
|
||||||
case 0:
|
case 0:
|
||||||
result += " Bytes";
|
result += ((value == 1) ? " Byte" : " Bytes");
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
result += " kB";
|
result += " kB";
|
||||||
|
@ -967,7 +967,7 @@ namespace hex::plugin::builtin {
|
|||||||
auto selection = this->getSelection();
|
auto selection = this->getSelection();
|
||||||
std::string value;
|
std::string value;
|
||||||
if (this->isSelectionValid())
|
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
|
else
|
||||||
value = std::string("hex.builtin.view.hex_editor.selection.none"_lang);
|
value = std::string("hex.builtin.view.hex_editor.selection.none"_lang);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user