| 661 | } |
| 662 | |
| 663 | void OnMouseLoop() override |
| 664 | { |
| 665 | /* Always close tooltips when the cursor is not in our window. */ |
| 666 | if (!_cursor.in_window) { |
| 667 | this->Close(); |
| 668 | return; |
| 669 | } |
| 670 | |
| 671 | /* We can show tooltips while dragging tools. These are shown as long as |
| 672 | * we are dragging the tool. Normal tooltips work with hover or rmb. */ |
| 673 | switch (this->close_cond) { |
| 674 | case TCC_RIGHT_CLICK: if (!_right_button_down) this->Close(); break; |
| 675 | case TCC_HOVER: if (!_mouse_hovering) this->Close(); break; |
| 676 | case TCC_NONE: break; |
| 677 | |
| 678 | case TCC_EXIT_VIEWPORT: { |
| 679 | Window *w = FindWindowFromPt(_cursor.pos.x, _cursor.pos.y); |
| 680 | if (w == nullptr || IsPtInWindowViewport(w, _cursor.pos.x, _cursor.pos.y) == nullptr) this->Close(); |
| 681 | break; |
| 682 | } |
| 683 | } |
| 684 | } |
| 685 | }; |
| 686 | |
| 687 | /** |
nothing calls this directly
no test coverage detected