| 308 | } |
| 309 | |
| 310 | void NodeComponent::Header::paint(Graphics& g) |
| 311 | { |
| 312 | auto textArea = getLocalBounds().toFloat(); |
| 313 | |
| 314 | auto leftMargin = 0.0f; |
| 315 | auto rightMargin = 0.0f; |
| 316 | |
| 317 | g.setColour(parent.getOutlineColour()); |
| 318 | g.fillAll(); |
| 319 | |
| 320 | auto b = getLocalBounds(); |
| 321 | b.removeFromLeft(1); |
| 322 | b.removeFromRight(1); |
| 323 | b.removeFromTop(1); |
| 324 | |
| 325 | g.setColour(JUCE_LIVE_CONSTANT_OFF(Colour(0x2b000000))); |
| 326 | g.fillRect(b); |
| 327 | |
| 328 | |
| 329 | |
| 330 | |
| 331 | String s; |
| 332 | |
| 333 | g.setFont(GLOBAL_BOLD_FONT()); |
| 334 | |
| 335 | s << parent.dataReference[PropertyIds::Name].toString(); |
| 336 | |
| 337 | if (parent.node.get()->isPolyphonic()) |
| 338 | s << " [poly]"; |
| 339 | |
| 340 | if (parent.node->getRootNetwork()->getCpuProfileFlag()) |
| 341 | { |
| 342 | s << parent.node->getCpuUsageInPercent(); |
| 343 | } |
| 344 | |
| 345 | leftMargin += textArea.getHeight(); |
| 346 | |
| 347 | if(parameterButton.isVisible()) |
| 348 | leftMargin += textArea.getHeight(); |
| 349 | |
| 350 | if(freezeButton.isVisible()) |
| 351 | rightMargin += textArea.getHeight(); |
| 352 | |
| 353 | |
| 354 | auto ar = getLocalBounds().toFloat(); |
| 355 | ar.removeFromRight(ar.getHeight()); |
| 356 | |
| 357 | rightMargin += textArea.getHeight(); |
| 358 | |
| 359 | if (parent.node->isClone()) |
| 360 | { |
| 361 | g.setColour(Colours::white.withAlpha(parent.node->isBypassed() ? 0.05f : 0.2f)); |
| 362 | auto p = f.createPath("clone"); |
| 363 | f.scalePath(p, ar.removeFromRight(ar.getHeight()).reduced(5.0f)); |
| 364 | |
| 365 | rightMargin += textArea.getHeight(); |
| 366 | |
| 367 | g.fillPath(p); |
nothing calls this directly
no test coverage detected