0x004C9513
| 908 | |
| 909 | // 0x004C9513 |
| 910 | WidgetIndex_t Window::findWidgetAt(int16_t xPos, int16_t yPos) |
| 911 | { |
| 912 | this->callPrepareDraw(); |
| 913 | |
| 914 | WidgetIndex_t activeWidget = kWidgetIndexNull; |
| 915 | |
| 916 | WidgetIndex_t widgetIndex = kWidgetIndexNull; |
| 917 | for (auto& widget : widgets) |
| 918 | { |
| 919 | widgetIndex++; |
| 920 | |
| 921 | if (widget.type == WidgetType::empty || widget.hidden) |
| 922 | { |
| 923 | continue; |
| 924 | } |
| 925 | |
| 926 | if (xPos < this->x + widget.left) |
| 927 | { |
| 928 | continue; |
| 929 | } |
| 930 | |
| 931 | if (xPos > this->x + widget.right) |
| 932 | { |
| 933 | continue; |
| 934 | } |
| 935 | |
| 936 | if (yPos < this->y + widget.top) |
| 937 | { |
| 938 | continue; |
| 939 | } |
| 940 | |
| 941 | if (yPos > this->y + widget.bottom) |
| 942 | { |
| 943 | continue; |
| 944 | } |
| 945 | |
| 946 | activeWidget = widgetIndex; |
| 947 | } |
| 948 | |
| 949 | if (activeWidget == kWidgetIndexNull) |
| 950 | { |
| 951 | return kWidgetIndexNull; |
| 952 | } |
| 953 | |
| 954 | if (this->widgets[activeWidget].type == WidgetType::combobox) |
| 955 | { |
| 956 | activeWidget++; |
| 957 | } |
| 958 | |
| 959 | return activeWidget; |
| 960 | } |
| 961 | |
| 962 | void Window::callClose() |
| 963 | { |
no test coverage detected