mirror of
https://github.com/WerWolv/ImHex.git
synced 2026-03-30 21:05:56 -05:00
feat: Added toggle for human-readable units in hex editor footer (#1251)
Finalization of #1245 by adding a toggle to the hex editor itself, issue can be closed afterwards.
This commit is contained in:
@@ -714,7 +714,9 @@ namespace hex::plugin::builtin::ui {
|
||||
selection.getStartAddress(),
|
||||
selection.getEndAddress(),
|
||||
selection.getSize(),
|
||||
hex::toByteString(selection.getSize())
|
||||
this->m_showHumanReadableUnits
|
||||
? hex::toByteString(selection.getSize())
|
||||
: hex::format("{}", selection.getSize())
|
||||
);
|
||||
}
|
||||
else
|
||||
@@ -733,7 +735,9 @@ namespace hex::plugin::builtin::ui {
|
||||
ImGui::TextFormattedSelectable("0x{0:08X} (0x{1:X} | {2})",
|
||||
this->m_provider->getActualSize(),
|
||||
this->m_provider->getActualSize(),
|
||||
hex::toByteString(this->m_provider->getActualSize())
|
||||
this->m_showHumanReadableUnits
|
||||
? hex::toByteString(this->m_provider->getActualSize())
|
||||
: hex::format("{}", this->m_provider->getActualSize())
|
||||
);
|
||||
}
|
||||
|
||||
@@ -766,6 +770,12 @@ namespace hex::plugin::builtin::ui {
|
||||
|
||||
ImGui::InfoTooltip("hex.builtin.hex_editor.custom_encoding_view"_lang);
|
||||
|
||||
ImGui::SameLine();
|
||||
|
||||
// Human-readable units
|
||||
ImGui::DimmedIconToggle(ICON_VS_SYMBOL_NUMERIC, &this->m_showHumanReadableUnits);
|
||||
ImGui::InfoTooltip("hex.builtin.hex_editor.human_readable_units_footer"_lang);
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
|
||||
// Visualizer
|
||||
|
||||
Reference in New Issue
Block a user