@@ -456,25 +456,54 @@ BuildTreeFromFlatbuffers(const Serialization::BehaviorTree *fb_behavior_tree)
456456}
457457
458458std::pair<QtNodes::NodeStyle, QtNodes::ConnectionStyle>
459- getStyleFromStatus (NodeStatus status)
459+ getStyleFromStatus (NodeStatus status, NodeStatus prev_status )
460460{
461461 QtNodes::NodeStyle node_style;
462462 QtNodes::ConnectionStyle conn_style;
463463
464+ float penWidth = 3.0 ;
465+
464466 conn_style.HoveredColor = Qt::transparent;
465467
468+ // printf("status=%d, old=%d\n", status, prev_status);
469+
466470 if ( status == NodeStatus::IDLE )
467471 {
472+ if (prev_status != NodeStatus::IDLE){
473+ node_style.PenWidth *= penWidth;
474+ node_style.HoveredPenWidth = node_style.PenWidth ;
475+
476+ if ( prev_status == NodeStatus::SUCCESS )
477+ {
478+ node_style.NormalBoundaryColor =
479+ node_style.ShadowColor = QColor (100 , 150 , 100 );
480+ conn_style.NormalColor = node_style.NormalBoundaryColor ;
481+ }
482+ else if ( prev_status == NodeStatus::RUNNING )
483+ {
484+ node_style.NormalBoundaryColor =
485+ node_style.ShadowColor = QColor (150 , 130 , 40 );
486+ conn_style.NormalColor = node_style.NormalBoundaryColor ;
487+ }
488+ else if ( prev_status == NodeStatus::FAILURE )
489+ {
490+ node_style.NormalBoundaryColor =
491+ node_style.ShadowColor = QColor (150 , 80 , 80 );
492+ conn_style.NormalColor = node_style.NormalBoundaryColor ;
493+ }
494+ }
495+
468496 return {node_style, conn_style};
469497 }
470498
471- node_style.PenWidth *= 3.0 ;
499+ node_style.PenWidth *= penWidth ;
472500 node_style.HoveredPenWidth = node_style.PenWidth ;
473501
474502 if ( status == NodeStatus::SUCCESS )
475503 {
476504 node_style.NormalBoundaryColor =
477505 node_style.ShadowColor = QColor (51 , 200 , 51 );
506+ node_style.ShadowColor = QColor (51 , 250 , 51 );
478507 conn_style.NormalColor = node_style.NormalBoundaryColor ;
479508 }
480509 else if ( status == NodeStatus::RUNNING )
0 commit comments