| 446 | } |
| 447 | |
| 448 | std::pair<QtNodes::NodeStyle, QtNodes::ConnectionStyle> |
| 449 | getStyleFromStatus(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 | |
| 486 | QtNodes::Node *GetParentNode(QtNodes::Node *node) |
| 487 | { |