| 1254 | } |
| 1255 | |
| 1256 | void OnClick([[maybe_unused]] Point pt, WidgetID widget, [[maybe_unused]] int click_count) override |
| 1257 | { |
| 1258 | if (widget == WID_MH_BACKGROUND) { |
| 1259 | /* Scheduled window invalidations currently occur after the input loop, which means the scrollbar count |
| 1260 | * could be invalid, so ensure it's correct now. Potentially this means that item clicked on might be |
| 1261 | * different as well. */ |
| 1262 | this->vscroll->SetCount(std::size(_news)); |
| 1263 | auto ni = this->vscroll->GetScrolledItemFromWidget(_news, pt.y, this, widget, WidgetDimensions::scaled.framerect.top); |
| 1264 | if (ni == std::end(_news)) return; |
| 1265 | |
| 1266 | ShowNewsMessage(ni); |
| 1267 | } |
| 1268 | } |
| 1269 | |
| 1270 | void OnResize() override |
| 1271 | { |
nothing calls this directly
no test coverage detected