mirror of https://github.com/WerWolv/ImHex.git
ui: Properly hide hidden patterns in hex editor view
This commit is contained in:
parent
f3f13ae4d3
commit
74f17fd638
|
@ -236,6 +236,9 @@ namespace hex::plugin::builtin {
|
||||||
|
|
||||||
std::optional<ImColor> color;
|
std::optional<ImColor> color;
|
||||||
for (const auto &pattern : ImHexApi::Provider::get()->getPatternLanguageRuntime().getPatterns(address)) {
|
for (const auto &pattern : ImHexApi::Provider::get()->getPatternLanguageRuntime().getPatterns(address)) {
|
||||||
|
if (pattern->isHidden())
|
||||||
|
continue;
|
||||||
|
|
||||||
if (color.has_value())
|
if (color.has_value())
|
||||||
color = ImAlphaBlendColors(*color, pattern->getColor());
|
color = ImAlphaBlendColors(*color, pattern->getColor());
|
||||||
else
|
else
|
||||||
|
@ -249,9 +252,12 @@ namespace hex::plugin::builtin {
|
||||||
hex::unused(data, size);
|
hex::unused(data, size);
|
||||||
|
|
||||||
auto patterns = ImHexApi::Provider::get()->getPatternLanguageRuntime().getPatterns(address);
|
auto patterns = ImHexApi::Provider::get()->getPatternLanguageRuntime().getPatterns(address);
|
||||||
if (!patterns.empty()) {
|
if (!patterns.empty() && !std::all_of(patterns.begin(), patterns.end(), [](const auto &pattern) { return pattern->isHidden(); })) {
|
||||||
ImGui::BeginTooltip();
|
ImGui::BeginTooltip();
|
||||||
for (const auto &pattern : patterns) {
|
for (const auto &pattern : patterns) {
|
||||||
|
if (pattern->isHidden())
|
||||||
|
continue;
|
||||||
|
|
||||||
auto tooltipColor = (pattern->getColor() & 0x00FF'FFFF) | 0x7000'0000;
|
auto tooltipColor = (pattern->getColor() & 0x00FF'FFFF) | 0x7000'0000;
|
||||||
ImGui::PushID(pattern);
|
ImGui::PushID(pattern);
|
||||||
if (ImGui::BeginTable("##tooltips", 1, ImGuiTableFlags_RowBg | ImGuiTableFlags_NoClip)) {
|
if (ImGui::BeginTable("##tooltips", 1, ImGuiTableFlags_RowBg | ImGuiTableFlags_NoClip)) {
|
||||||
|
|
Loading…
Reference in New Issue