From f36014194d7207ff7f3876d0905c54269aca937b Mon Sep 17 00:00:00 2001 From: WerWolv Date: Fri, 20 Nov 2020 00:16:50 +0100 Subject: [PATCH] Bring strings view and pattern data view in line with each other --- include/lang/pattern_data.hpp | 2 +- source/views/view_pattern_data.cpp | 2 +- source/views/view_strings.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/lang/pattern_data.hpp b/include/lang/pattern_data.hpp index c47b25e9c..81e60a826 100644 --- a/include/lang/pattern_data.hpp +++ b/include/lang/pattern_data.hpp @@ -73,7 +73,7 @@ namespace hex::lang { else return left->getName() < right->getName(); } - else if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("position")) { + else if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("offset")) { if (sortSpecs->Specs->SortDirection == ImGuiSortDirection_Ascending) return left->getOffset() > right->getOffset(); else diff --git a/source/views/view_pattern_data.cpp b/source/views/view_pattern_data.cpp index 40e45bef5..771da3a1c 100644 --- a/source/views/view_pattern_data.cpp +++ b/source/views/view_pattern_data.cpp @@ -21,7 +21,7 @@ namespace hex { if (ImGui::BeginTable("##patterndatatable", 6, ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_Sortable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_RowBg)) { ImGui::TableSetupColumn("Color", 0, -1, ImGui::GetID("color")); ImGui::TableSetupColumn("Name", 0, -1, ImGui::GetID("name")); - ImGui::TableSetupColumn("Position", 0, -1, ImGui::GetID("position")); + ImGui::TableSetupColumn("Offset", 0, -1, ImGui::GetID("offset")); ImGui::TableSetupColumn("Size", 0, -1, ImGui::GetID("size")); ImGui::TableSetupColumn("Type", 0, -1, ImGui::GetID("type")); ImGui::TableSetupColumn("Value", 0, -1, ImGui::GetID("value")); diff --git a/source/views/view_strings.cpp b/source/views/view_strings.cpp index e5169df08..65d0dffc7 100644 --- a/source/views/view_strings.cpp +++ b/source/views/view_strings.cpp @@ -73,7 +73,7 @@ namespace hex { if (ImGui::BeginTable("##strings", 3, ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_Sortable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_RowBg)) { - ImGui::TableSetupColumn("Position", 0, -1, ImGui::GetID("position")); + ImGui::TableSetupColumn("Offset", 0, -1, ImGui::GetID("offset")); ImGui::TableSetupColumn("Size", 0, -1, ImGui::GetID("size")); ImGui::TableSetupColumn("String", 0, -1, ImGui::GetID("string")); @@ -82,7 +82,7 @@ namespace hex { if (sortSpecs->SpecsDirty) { std::sort(this->m_foundStrings.begin(), this->m_foundStrings.end(), [&sortSpecs](FoundString &left, FoundString &right) -> bool { - if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("position")) { + if (sortSpecs->Specs->ColumnUserID == ImGui::GetID("offset")) { if (sortSpecs->Specs->SortDirection == ImGuiSortDirection_Ascending) return left.offset > right.offset; else @@ -120,9 +120,9 @@ namespace hex { ImGui::TableNextRow(ImGuiTableRowFlags_Headers); ImGui::TableNextColumn(); - ImGui::Text("0x%08lx:0x%08lx", foundString.offset, foundString.offset + foundString.size); + ImGui::Text("0x%08lx : 0x%08lx", foundString.offset, foundString.offset + foundString.size); ImGui::TableNextColumn(); - ImGui::Text("%08lx", foundString.size); + ImGui::Text("0x%04lx", foundString.size); ImGui::TableNextColumn(); ImGui::Text("%s", foundString.string.c_str()); ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0,