Code editor for Custom pattern gstreamer

Bugfix in Streamsource and UI
This commit is contained in:
Bruno Herbelin
2022-01-01 23:59:30 +01:00
parent f0ca13150f
commit 4426f70de7
8 changed files with 109 additions and 116 deletions

View File

@@ -898,11 +898,16 @@ void ImGuiVisitor::visit (GenericStreamSource& s)
ImGui::SetCursorPos(pos);
}
// display pipeline text
std::string pipelinetxt = BaseToolkit::wrapped( s.description(), 20);
ImGuiToolkit::CodeMultiline("Pipeline", pipelinetxt, w);
// // TODO allow editing pipeline
// Prepare display pipeline text
static int numlines = 0;
const ImGuiContext& g = *GImGui;
ImVec2 fieldsize(w, MAX(3, numlines) * g.FontSize + g.Style.ItemSpacing.y + g.Style.FramePadding.y);
// Editor
std::string _description = s.description();
if ( ImGuiToolkit::InputCodeMultiline("Pipeline", &_description, fieldsize, &numlines) ) {
s.setDescription(_description);
Action::manager().store( s.name() + ": Change pipeline");
}
}