From 559b86efe1ef8886bc0419cd619362f3c9fec102 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Thu, 3 Mar 2022 13:33:45 +0100 Subject: [PATCH] patterns: Display actual type name of types declared with `using` --- lib/libimhex/include/hex/pattern_language/patterns/pattern.hpp | 2 +- .../include/hex/pattern_language/patterns/pattern_pointer.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libimhex/include/hex/pattern_language/patterns/pattern.hpp b/lib/libimhex/include/hex/pattern_language/patterns/pattern.hpp index 5cb6f83a8..5f28792a8 100644 --- a/lib/libimhex/include/hex/pattern_language/patterns/pattern.hpp +++ b/lib/libimhex/include/hex/pattern_language/patterns/pattern.hpp @@ -256,7 +256,7 @@ namespace hex::pl { ImGui::TableNextColumn(); ImGui::TextFormatted("0x{0:04X}", this->getSize()); ImGui::TableNextColumn(); - ImGui::TextFormattedColored(ImColor(0xFF9BC64D), "{}", this->getFormattedName()); + ImGui::TextFormattedColored(ImColor(0xFF9BC64D), "{}", this->getTypeName().empty() ? this->getFormattedName() : this->getTypeName()); ImGui::TableNextColumn(); ImGui::TextFormatted("{}", formatDisplayValue(value, std::move(literal))); } diff --git a/lib/libimhex/include/hex/pattern_language/patterns/pattern_pointer.hpp b/lib/libimhex/include/hex/pattern_language/patterns/pattern_pointer.hpp index 8bd25c9b8..28a4698e5 100644 --- a/lib/libimhex/include/hex/pattern_language/patterns/pattern_pointer.hpp +++ b/lib/libimhex/include/hex/pattern_language/patterns/pattern_pointer.hpp @@ -61,7 +61,7 @@ namespace hex::pl { } [[nodiscard]] std::string getFormattedName() const override { - std::string result = this->m_pointedAt->getFormattedName() + "* : "; + std::string result = this->getTypeName().empty() ? this->getFormattedName() : this->getTypeName() + "* : "; switch (this->getSize()) { case 1: result += "u8";