1
0
mirror of synced 2024-11-24 15:50:16 +01:00

Use the ID stack the way it was meant to be used

This commit is contained in:
WerWolv 2021-01-13 16:55:42 +01:00
parent c1ad816211
commit c7d179d68e

View File

@ -60,6 +60,7 @@ namespace hex {
auto hoverColor = ImColor(color);
hoverColor.Value.w *= 1.3F;
ImGui::PushID(id);
ImGui::PushStyleColor(ImGuiCol_Header, color);
ImGui::PushStyleColor(ImGuiCol_HeaderActive, color);
ImGui::PushStyleColor(ImGuiCol_HeaderHovered, u32(hoverColor));
@ -84,39 +85,30 @@ namespace hex {
ImGui::TextColored(ImColor(0xFF9BC64D), bytesString.c_str());
}
ImGui::PushID(id);
if (ImGui::Button("Jump to"))
View::postEvent(Events::SelectionChangeRequest, &region);
ImGui::PopID();
ImGui::SameLine(0, 15);
ImGui::PushID(id + 1);
if (ImGui::Button("Remove"))
bookmarkToRemove = iter;
ImGui::PopID();
ImGui::NewLine();
ImGui::TextUnformatted("Name");
ImGui::Separator();
ImGui::PushID(id + 2);
ImGui::InputText("##nolabel", name.data(), 64);
ImGui::PopID();
ImGui::InputText("##nameInput", name.data(), 64);
ImGui::SameLine();
ImGui::PushID(id + 3);
ImGui::ColorEdit4("Color", (float*)&headerColor.Value, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel | ImGuiColorEditFlags_NoAlpha);
color = headerColor;
ImGui::PopID();
ImGui::NewLine();
ImGui::TextUnformatted("Comment");
ImGui::Separator();
ImGui::PushID(id + 4);
ImGui::InputTextMultiline("##nolabel", comment.data(), 0xF'FFFF);
ImGui::PopID();
ImGui::InputTextMultiline("##colorInput", comment.data(), 0xF'FFFF);
ImGui::NewLine();
id += 5;
}
ImGui::PopID();
ImGui::PopStyleColor(3);
id++;
}
if (bookmarkToRemove != this->m_bookmarks.end()) {