MCPcopy Create free account
hub / github.com/BehaviorTree/Groot / getStyleFromStatus

Function getStyleFromStatus

bt_editor/utils.cpp:448–484  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446}
447
448std::pair<QtNodes::NodeStyle, QtNodes::ConnectionStyle>
449getStyleFromStatus(NodeStatus status)
450{
451 QtNodes::NodeStyle node_style;
452 QtNodes::ConnectionStyle conn_style;
453
454 conn_style.HoveredColor = Qt::transparent;
455
456 if( status == NodeStatus::IDLE )
457 {
458 return {node_style, conn_style};
459 }
460
461 node_style.PenWidth *= 3.0;
462 node_style.HoveredPenWidth = node_style.PenWidth;
463
464 if( status == NodeStatus::SUCCESS )
465 {
466 node_style.NormalBoundaryColor =
467 node_style.ShadowColor = QColor(51, 200, 51);
468 conn_style.NormalColor = node_style.NormalBoundaryColor;
469 }
470 else if( status == NodeStatus::RUNNING )
471 {
472 node_style.NormalBoundaryColor =
473 node_style.ShadowColor = QColor(220, 140, 20);
474 conn_style.NormalColor = node_style.NormalBoundaryColor;
475 }
476 else if( status == NodeStatus::FAILURE )
477 {
478 node_style.NormalBoundaryColor =
479 node_style.ShadowColor = QColor(250, 50, 50);
480 conn_style.NormalColor = node_style.NormalBoundaryColor;
481 }
482
483 return {node_style, conn_style};
484}
485
486QtNodes::Node *GetParentNode(QtNodes::Node *node)
487{

Callers 1

onChangeNodesStatusMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected