diff --git a/source/views/view_data_inspector.cpp b/source/views/view_data_inspector.cpp index 664aaa5e3..dc449f85f 100644 --- a/source/views/view_data_inspector.cpp +++ b/source/views/view_data_inspector.cpp @@ -111,21 +111,18 @@ namespace hex { if (ImGui::Begin("Data Inspector", &this->m_windowOpen)) { if (this->m_dataProvider != nullptr && this->m_dataProvider->isReadable()) { if (ImGui::BeginChild("##scrolling", ImVec2(0, ImGui::GetWindowHeight() - 60))) { - if (ImGui::BeginTable("##datainspector", 2, ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_RowBg)) { + if (ImGui::BeginTable("##datainspector", 2, ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_RowBg | ImGuiTableFlags_NoBordersInBody)) { ImGui::TableSetupColumn("Name"); ImGui::TableSetupColumn("Value"); ImGui::TableHeadersRow(); - u32 rowCount = 0; + for (const auto &[name, value] : this->m_cachedData) { ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGui::TextUnformatted(name.c_str()); ImGui::TableNextColumn(); ImGui::TextUnformatted(value.c_str()); - ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0, - ((rowCount % 2) == 0) ? 0xFF101010 : 0xFF303030); - rowCount++; } { @@ -135,9 +132,6 @@ namespace hex { ImGui::TableNextColumn(); ImGui::ColorButton("##nolabel", ImColor(hex::changeEndianess(this->m_previewData.unsigned32, this->m_endianess)), ImGuiColorEditFlags_None, ImVec2(ImGui::GetColumnWidth(), 15)); - ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0, - ((rowCount % 2) == 0) ? 0xFF101010 : 0xFF303030); - rowCount++; } diff --git a/source/views/view_pattern_data.cpp b/source/views/view_pattern_data.cpp index 771da3a1c..b982a12c5 100644 --- a/source/views/view_pattern_data.cpp +++ b/source/views/view_pattern_data.cpp @@ -18,7 +18,7 @@ namespace hex { } static bool beginPatternDataTable(prv::Provider* &provider, const std::vector &patterns, std::vector &sortedPatterns) { - if (ImGui::BeginTable("##patterndatatable", 6, ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_Sortable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_RowBg)) { + if (ImGui::BeginTable("##patterndatatable", 6, ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_Sortable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_RowBg | ImGuiTableFlags_NoBordersInBody)) { ImGui::TableSetupColumn("Color", 0, -1, ImGui::GetID("color")); ImGui::TableSetupColumn("Name", 0, -1, ImGui::GetID("name")); ImGui::TableSetupColumn("Offset", 0, -1, ImGui::GetID("offset")); @@ -60,13 +60,8 @@ namespace hex { if (this->m_sortedPatternData.size() > 0) { ImGui::TableHeadersRow(); - u32 rowCount = 0; - for (auto &patternData : this->m_sortedPatternData) { + for (auto &patternData : this->m_sortedPatternData) patternData->createEntry(this->m_dataProvider); - ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0, - ((rowCount % 2) == 0) ? 0xFF101010 : 0xFF303030); - rowCount++; - } } diff --git a/source/views/view_strings.cpp b/source/views/view_strings.cpp index 1e6ff2450..91524da1d 100644 --- a/source/views/view_strings.cpp +++ b/source/views/view_strings.cpp @@ -74,7 +74,7 @@ namespace hex { if (ImGui::BeginTable("##strings", 3, ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_Sortable | - ImGuiTableFlags_Reorderable | ImGuiTableFlags_RowBg)) { + ImGuiTableFlags_Reorderable | ImGuiTableFlags_RowBg | ImGuiTableFlags_NoBordersInBody)) { ImGui::TableSetupColumn("Offset", 0, -1, ImGui::GetID("offset")); ImGui::TableSetupColumn("Size", 0, -1, ImGui::GetID("size")); ImGui::TableSetupColumn("String", 0, -1, ImGui::GetID("string")); @@ -113,7 +113,6 @@ namespace hex { clipper.Begin(this->m_foundStrings.size()); while (clipper.Step()) { - u32 rowCount = clipper.DisplayStart; for (u64 i = clipper.DisplayStart; i < clipper.DisplayEnd; i++) { auto &foundString = this->m_foundStrings[i]; @@ -128,9 +127,6 @@ namespace hex { ImGui::Text("0x%04lx", foundString.size); ImGui::TableNextColumn(); ImGui::Text("%s", foundString.string.c_str()); - ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0, - ((rowCount % 2) == 0) ? 0xFF101010 : 0xFF303030); - rowCount++; } } clipper.End();