* Get the button at a given point on the line. * @param r Rect of line. * @param pt Point of interest. * @return Button at point, or \c nullptr if button isn't pressed. */
| 1410 | * @return Button at point, or \c nullptr if button isn't pressed. |
| 1411 | */ |
| 1412 | ButtonCommon *GetButton(Rect r, const Point &pt) const |
| 1413 | { |
| 1414 | bool rtl = _current_text_dir == TD_RTL; |
| 1415 | for (auto &button : this->buttons) { |
| 1416 | if (r.WithWidth(button->width, !rtl).Contains(pt)) return button.get(); |
| 1417 | r = r.Indent(button->width + WidgetDimensions::scaled.hsep_normal, !rtl); |
| 1418 | } |
| 1419 | return nullptr; |
| 1420 | } |
| 1421 | |
| 1422 | /** |
| 1423 | * Get tooptip for a given point on the line. |