impr: Move selection information to the top of the hex editor footer
This commit is contained in:
parent
8f3f941600
commit
f6c59b456f
@ -834,6 +834,9 @@ namespace hex::ui {
|
|||||||
const auto pageCount = std::max<u32>(1, m_provider->getPageCount());
|
const auto pageCount = std::max<u32>(1, m_provider->getPageCount());
|
||||||
constexpr static u32 MinPage = 1;
|
constexpr static u32 MinPage = 1;
|
||||||
|
|
||||||
|
const auto pageAddress = m_provider->getCurrentPageAddress();
|
||||||
|
const auto pageSize = m_provider->getSize();
|
||||||
|
|
||||||
// Page slider
|
// Page slider
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
{
|
{
|
||||||
@ -845,7 +848,11 @@ namespace hex::ui {
|
|||||||
ImGui::BeginDisabled(pageCount <= 1);
|
ImGui::BeginDisabled(pageCount <= 1);
|
||||||
{
|
{
|
||||||
ImGui::PushItemWidth(-1);
|
ImGui::PushItemWidth(-1);
|
||||||
if (ImGui::SliderScalar("##page_selection", ImGuiDataType_U32, &page, &MinPage, &pageCount, hex::format("0x%02llX / 0x{:02X}", pageCount).c_str()))
|
if (ImGui::SliderScalar("##page_selection", ImGuiDataType_U32, &page, &MinPage, &pageCount,
|
||||||
|
hex::format("0x%02llX / 0x{0:02X} [0x{1:04X} - 0x{2:04X}]",
|
||||||
|
pageCount,
|
||||||
|
pageAddress,
|
||||||
|
pageSize == 0 ? 0 : (pageAddress + pageSize - 1)).c_str()))
|
||||||
m_provider->setCurrentPage(page - 1);
|
m_provider->setCurrentPage(page - 1);
|
||||||
ImGui::PopItemWidth();
|
ImGui::PopItemWidth();
|
||||||
}
|
}
|
||||||
@ -859,22 +866,6 @@ namespace hex::ui {
|
|||||||
m_footerCollapsed = !m_footerCollapsed;
|
m_footerCollapsed = !m_footerCollapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Page Address
|
|
||||||
ImGui::TableNextColumn();
|
|
||||||
{
|
|
||||||
const auto pageAddress = m_provider->getCurrentPageAddress();
|
|
||||||
const auto pageSize = m_provider->getSize();
|
|
||||||
ImGuiExt::TextFormatted("{}:", "hex.ui.hex_editor.region"_lang);
|
|
||||||
ImGui::SameLine();
|
|
||||||
ImGuiExt::TextFormattedSelectable("0x{0:08X} - 0x{1:08X} ({0} - {1})",
|
|
||||||
pageAddress,
|
|
||||||
pageSize == 0 ? 0 : (pageAddress + pageSize - 1)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!m_footerCollapsed) {
|
|
||||||
ImGui::TableNextRow();
|
|
||||||
|
|
||||||
// Selection
|
// Selection
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
{
|
{
|
||||||
@ -898,6 +889,21 @@ namespace hex::ui {
|
|||||||
ImGuiExt::TextFormattedSelectable(value);
|
ImGuiExt::TextFormattedSelectable(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!m_footerCollapsed) {
|
||||||
|
ImGui::TableNextRow();
|
||||||
|
|
||||||
|
// Page Address
|
||||||
|
ImGui::TableNextColumn();
|
||||||
|
{
|
||||||
|
|
||||||
|
ImGuiExt::TextFormatted("{}:", "hex.ui.hex_editor.region"_lang);
|
||||||
|
ImGui::SameLine();
|
||||||
|
ImGuiExt::TextFormattedSelectable("0x{0:08X} - 0x{1:08X} ({0} - {1})",
|
||||||
|
pageAddress,
|
||||||
|
pageSize == 0 ? 0 : (pageAddress + pageSize - 1)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
|
|
||||||
// Loaded data size
|
// Loaded data size
|
||||||
|
Loading…
x
Reference in New Issue
Block a user