| 50 | |
| 51 | |
| 52 | PlugWidget::PlugWidget() { |
| 53 | internal = new Internal; |
| 54 | |
| 55 | internal->fb = new widget::FramebufferWidget; |
| 56 | addChild(internal->fb); |
| 57 | |
| 58 | internal->plugTransform = new widget::TransformWidget; |
| 59 | internal->fb->addChild(internal->plugTransform); |
| 60 | |
| 61 | internal->plugTint = new TintWidget; |
| 62 | internal->plugTransform->addChild(internal->plugTint); |
| 63 | |
| 64 | internal->plug = new widget::SvgWidget; |
| 65 | internal->plug->setSvg(window::Svg::load(asset::system("res/ComponentLibrary/Plug.svg"))); |
| 66 | internal->plugTint->addChild(internal->plug); |
| 67 | internal->plugTransform->setSize(internal->plug->getSize()); |
| 68 | internal->plugTransform->setPosition(internal->plug->getSize().mult(-0.5)); |
| 69 | internal->plugTint->setSize(internal->plug->getSize()); |
| 70 | |
| 71 | internal->plugPort = new widget::SvgWidget; |
| 72 | internal->plugPort->setSvg(window::Svg::load(asset::system("res/ComponentLibrary/PlugPort.svg"))); |
| 73 | internal->plugPort->setPosition(internal->plugPort->getSize().mult(-0.5)); |
| 74 | internal->fb->addChild(internal->plugPort); |
| 75 | |
| 76 | internal->plugLight = new PlugLight; |
| 77 | internal->plugLight->setPosition(internal->plugLight->getSize().mult(-0.5)); |
| 78 | addChild(internal->plugLight); |
| 79 | |
| 80 | setSize(internal->plug->getSize()); |
| 81 | } |
| 82 | |
| 83 | |
| 84 | PlugWidget::~PlugWidget() { |