BugFix source editor if playable

This commit is contained in:
Bruno Herbelin
2022-07-23 12:07:44 +02:00
parent 7a2f3fe840
commit ae5ae24f6f
2 changed files with 8 additions and 10 deletions

View File

@@ -993,12 +993,14 @@ void ImGuiVisitor::visit (CloneSource& s)
ImGui::PopTextWrapPos();
// icon (>) to open player
ImVec2 pos = ImGui::GetCursorPos();
ImGui::SameLine(0, 0);
ImGui::SameLine(0, 10.f + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN);
if (ImGuiToolkit::IconButton(ICON_FA_PLAY_CIRCLE, "Open in Player"))
UserInterface::manager().showSourceEditor(&s);
ImGui::SetCursorPos(pos);
if ( s.playable() ) {
ImVec2 pos = ImGui::GetCursorPos();
ImGui::SameLine(0, 0);
ImGui::SameLine(0, 10.f + ImGui::GetContentRegionAvail().x IMGUI_RIGHT_ALIGN);
if (ImGuiToolkit::IconButton(ICON_FA_PLAY_CIRCLE, "Open in Player"))
UserInterface::manager().showSourceEditor(&s);
ImGui::SetCursorPos(pos);
}
// link to origin source
std::string label = std::string(s.origin()->initials()) + " - " + s.origin()->name();