| 49 | } |
| 50 | |
| 51 | static int32_t WindowGetScrollIndex(const WindowBase& w, int32_t targetWidgetIndex) |
| 52 | { |
| 53 | if (w.widgets[targetWidgetIndex].type != WidgetType::scroll) |
| 54 | return -1; |
| 55 | |
| 56 | int32_t scrollIndex = 0; |
| 57 | for (WidgetIndex widgetIndex = 0; widgetIndex < w.widgets.size(); widgetIndex++) |
| 58 | { |
| 59 | if (widgetIndex == targetWidgetIndex) |
| 60 | break; |
| 61 | auto& widget = w.widgets[widgetIndex]; |
| 62 | if (widget.type == WidgetType::scroll) |
| 63 | scrollIndex++; |
| 64 | } |
| 65 | |
| 66 | return scrollIndex; |
| 67 | } |
| 68 | |
| 69 | static Widget* WindowGetScrollWidget(const WindowBase& w, int32_t scrollIndex) |
| 70 | { |
no test coverage detected