* Compute the row of a scrolled widget that a user clicked in. * @param clickpos Vertical position of the mouse click (without taking scrolling into account). * @param w The window the click was in. * @param widget Widget number of the widget clicked in. * @param padding Amount of empty space between the widget edge and the top of the first row. Default value is \c 0. *
| 2451 | * @return Row number clicked at. If clicked at a wrong position, #Scrollbar::npos is returned. |
| 2452 | */ |
| 2453 | Scrollbar::size_type Scrollbar::GetScrolledRowFromWidget(int clickpos, const Window * const w, WidgetID widget, int padding, int line_height) const |
| 2454 | { |
| 2455 | int pos = w->GetRowFromWidget(clickpos, widget, padding, line_height); |
| 2456 | if (pos != INT_MAX) pos += this->GetPosition(); |
| 2457 | return (pos < 0 || pos >= this->GetCount()) ? Scrollbar::npos : pos; |
| 2458 | } |
| 2459 | |
| 2460 | /** |
| 2461 | * Update the given list position as if it were on this scroll bar when the given keycode was pressed. |
no test coverage detected