Hi,
Is there a way to change the border size of the current child window when is being hovered? The code below doesn’t work as expected. I can see that the right window is identified as hovered but it has no border:
ImGui::PushStyleVar(ImGuiStyleVar_ChildBorderSize, 0.f);
ImGui::Begin(_name.c_str(), 0,
ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_HorizontalScrollbar);
const int nrLayouts = 15;
const ImVec2 layoutSize{ 1024, 1024 };
const ImGuiWindowFlags layoutFlags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove;
for (int i = 0; i < nrLayouts; i++) {
std::string layoutName{ std::string("Layout##") + std::to_string(i) };
if (ImGui::BeginChild(layoutName.c_str(), layoutSize, true)) {
if (ImGui::IsWindowHovered()) {
ImGui::PushStyleVar(ImGuiStyleVar_ChildBorderSize, 2.f);
ImGui::Text("Layout HOVERED: %i", i);
ImGui::PopStyleVar();
} else {
ImGui::Text("Layout: %i", i);
}
}
ImGui::EndChild();
ImGui::SameLine(0.f, 100.f);
}
ImGui::PopStyleVar(1);
ImGui::End();
ImGui::Render();