From ec080ad69f257b640b1feaa33c3c989712f67871 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 26 Jun 2024 19:14:43 +0200 Subject: [PATCH] fix: Indentation and wrapping of pattern hex editor tooltips --- .../content/views/view_pattern_editor.cpp | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/plugins/builtin/source/content/views/view_pattern_editor.cpp b/plugins/builtin/source/content/views/view_pattern_editor.cpp index 4200fd133..f90469551 100644 --- a/plugins/builtin/source/content/views/view_pattern_editor.cpp +++ b/plugins/builtin/source/content/views/view_pattern_editor.cpp @@ -1496,38 +1496,50 @@ namespace hex::plugin::builtin { path = path.substr(1); } - ImGuiExt::TextFormatted(" {}", path); + ImGui::Indent(); + ImGuiExt::TextFormattedWrapped("{}", path); + ImGui::Unindent(); ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGuiExt::TextFormatted("{} ", "hex.ui.common.type"_lang); ImGui::TableNextColumn(); - ImGuiExt::TextFormatted(" {}", pattern->getFormattedName()); + ImGui::Indent(); + ImGuiExt::TextFormatted("{}", pattern->getFormattedName()); + ImGui::Unindent(); ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGuiExt::TextFormatted("{} ", "hex.ui.common.address"_lang); ImGui::TableNextColumn(); - ImGuiExt::TextFormatted(" 0x{:08X}", pattern->getOffset()); + ImGui::Indent(); + ImGuiExt::TextFormatted("0x{:08X}", pattern->getOffset()); + ImGui::Unindent(); ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGuiExt::TextFormatted("{} ", "hex.ui.common.size"_lang); ImGui::TableNextColumn(); - ImGuiExt::TextFormatted(" {}", hex::toByteString(pattern->getSize())); + ImGui::Indent(); + ImGuiExt::TextFormatted("{}", hex::toByteString(pattern->getSize())); + ImGui::Unindent(); ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGuiExt::TextFormatted("{} ", "hex.ui.common.endian"_lang); ImGui::TableNextColumn(); - ImGuiExt::TextFormatted(" {}", pattern->getEndian() == std::endian::little ? "hex.ui.common.little"_lang : "hex.ui.common.big"_lang); + ImGui::Indent(); + ImGuiExt::TextFormatted("{}", pattern->getEndian() == std::endian::little ? "hex.ui.common.little"_lang : "hex.ui.common.big"_lang); + ImGui::Unindent(); if (const auto &comment = pattern->getComment(); !comment.empty()) { ImGui::TableNextRow(); ImGui::TableNextColumn(); ImGuiExt::TextFormatted("{} ", "hex.ui.common.comment"_lang); ImGui::TableNextColumn(); - ImGuiExt::TextFormattedWrapped(" \"{}\"", comment); + ImGui::Indent(); + ImGuiExt::TextFormattedWrapped("\"{}\"", comment); + ImGui::Unindent(); } ImGui::EndTable();