| 303 | } |
| 304 | |
| 305 | Widget* RelativeLayoutManager::getRelativeWidget(Widget* widget) |
| 306 | { |
| 307 | Widget* relativeWidget = nullptr; |
| 308 | RelativeLayoutParameter* layoutParameter = dynamic_cast<RelativeLayoutParameter*>(widget->getLayoutParameter()); |
| 309 | auto relativeName = layoutParameter->getRelativeToWidgetName(); |
| 310 | |
| 311 | if (!relativeName.empty()) |
| 312 | { |
| 313 | for (auto&& sWidget : _widgetChildren) |
| 314 | { |
| 315 | if (sWidget) |
| 316 | { |
| 317 | RelativeLayoutParameter* rlayoutParameter = |
| 318 | dynamic_cast<RelativeLayoutParameter*>(sWidget->getLayoutParameter()); |
| 319 | if (rlayoutParameter && rlayoutParameter->getRelativeName() == relativeName) |
| 320 | { |
| 321 | relativeWidget = sWidget; |
| 322 | _relativeWidgetLP = rlayoutParameter; |
| 323 | break; |
| 324 | } |
| 325 | } |
| 326 | } |
| 327 | } |
| 328 | return relativeWidget; |
| 329 | } |
| 330 | |
| 331 | bool RelativeLayoutManager::calculateFinalPositionWithRelativeWidget(LayoutProtocol* layout) |
| 332 | { |
no test coverage detected