| 1137 | } |
| 1138 | |
| 1139 | static void windowScrollWheelInput(Ui::Window& window, WidgetIndex_t widgetIndex, int wheel) |
| 1140 | { |
| 1141 | int scrollIndex = window.getScrollDataIndex(widgetIndex); |
| 1142 | ScrollArea* scroll = &window.scrollAreas[scrollIndex]; |
| 1143 | Ui::Widget* widget = &window.widgets[widgetIndex]; |
| 1144 | |
| 1145 | if (window.scrollAreas[scrollIndex].hasFlags(ScrollFlags::vscrollbarVisible)) |
| 1146 | { |
| 1147 | int size = widget->bottom - widget->top - 1; |
| 1148 | if (scroll->hasFlags(ScrollFlags::hscrollbarVisible)) |
| 1149 | { |
| 1150 | size -= 11; |
| 1151 | } |
| 1152 | size = std::max(0, scroll->contentHeight - size); |
| 1153 | scroll->contentOffsetY = std::clamp(scroll->contentOffsetY + wheel, 0, size); |
| 1154 | } |
| 1155 | else if (window.scrollAreas[scrollIndex].hasFlags(ScrollFlags::hscrollbarVisible)) |
| 1156 | { |
| 1157 | int size = widget->right - widget->left - 1; |
| 1158 | if (scroll->hasFlags(ScrollFlags::vscrollbarVisible)) |
| 1159 | { |
| 1160 | size -= 11; |
| 1161 | } |
| 1162 | size = std::max(0, scroll->contentWidth - size); |
| 1163 | scroll->contentOffsetX = std::clamp(scroll->contentOffsetX + wheel, 0, size); |
| 1164 | } |
| 1165 | |
| 1166 | Ui::ScrollView::updateThumbs(window, widgetIndex); |
| 1167 | invalidateWidget(window.type, window.number, widgetIndex); |
| 1168 | } |
| 1169 | |
| 1170 | static bool isStepperGroup(Window& w, WidgetIndex_t index, WidgetType buttonType) |
| 1171 | { |
no test coverage detected