@@ -415,12 +415,29 @@ bool ImGuiEx::NodeCanvas::BeginNode( int nId, const char* _id, std::string name,
415415
416416 // Header info
417417 ImGui::SetCursorScreenPos ( curNodeData.outerContentBox .Min +ImVec2 (5 , ((IMGUI_EX_NODE_HEADER_HEIGHT*scaleFactor)-ImGui::CalcTextSize (" " ).y )*.5f ) );// canvasView.translation+pos+ImVec2(5,4));
418- if (nId == activeNode){
419- ImGui::PushStyleColor (ImGuiCol_Text, IM_COL32 (255 ,255 ,255 ,255 ));
418+
419+ if (name.find (' |' ) != std::string::npos ){
420+ if (nId == activeNode){
421+ std::string nodeName = name.substr (0 , name.find (' |' )+1 );
422+ std::string specialName = name.substr (name.find (' |' )+2 );
423+ ImGui::PushStyleColor (ImGuiCol_Text, IM_COL32 (255 ,255 ,255 ,255 ));
424+ ImGui::Text (" %s" , nodeName.c_str ()); // node name
425+ ImGui::SameLine ();
426+ ImGui::PushStyleColor (ImGuiCol_Text, IM_COL32 (200 ,220 ,240 ,255 ));
427+ ImGui::Text (" %s" , specialName.c_str ()); // special name
428+ }else {
429+ ImGui::PushStyleColor (ImGuiCol_Text, IM_COL32 (0 ,0 ,0 ,255 ));
430+ ImGui::Text (" %s" , name.c_str ()); // title
431+ }
420432 }else {
421- ImGui::PushStyleColor (ImGuiCol_Text, IM_COL32 (0 ,0 ,0 ,255 ));
433+ if (nId == activeNode){
434+ ImGui::PushStyleColor (ImGuiCol_Text, IM_COL32 (255 ,255 ,255 ,255 ));
435+ }else {
436+ ImGui::PushStyleColor (ImGuiCol_Text, IM_COL32 (0 ,0 ,0 ,255 ));
437+ }
438+ ImGui::Text (" %s" , name.c_str ()); // title
422439 }
423- ImGui::Text ( " %s " , name. c_str ()); // title
440+
424441 ImGui::PopStyleColor ();
425442
426443 // Enable drag on title
0 commit comments