diff options
| author | Jordan Woyak <jordan.woyak@gmail.com> | 2024-03-18 23:16:18 -0500 |
|---|---|---|
| committer | Jordan Woyak <jordan.woyak@gmail.com> | 2024-03-20 03:13:11 -0500 |
| commit | 647eba36f3bbf8b5e4a6d141bf3c8dc087548cfd (patch) | |
| tree | bb99c17223255a809e23cd3036e81f63f349165c /Source | |
| parent | 85dee300b5bbd8c64dee5e9305a626435bef2062 (diff) | |
DolphinQt: Fix BalloonTip positioning on secondary monitors.
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/DolphinQt/Config/ToolTipControls/BalloonTip.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/Core/DolphinQt/Config/ToolTipControls/BalloonTip.cpp b/Source/Core/DolphinQt/Config/ToolTipControls/BalloonTip.cpp index 672a4381f8..52033a9445 100644 --- a/Source/Core/DolphinQt/Config/ToolTipControls/BalloonTip.cpp +++ b/Source/Core/DolphinQt/Config/ToolTipControls/BalloonTip.cpp @@ -315,10 +315,12 @@ void BalloonTip::UpdateBoundsAndRedraw(const QPoint& target_arrow_tip_position, // Place the arrow tip at the target position whether the arrow tip is drawn or not const int target_balloontip_global_x = target_arrow_tip_position.x() - static_cast<int>(arrow_tip_x); - const int rightmost_valid_balloontip_global_x = screen_rect.width() - size_hint.width(); + const int rightmost_valid_balloontip_global_x = + screen_rect.left() + screen_rect.width() - size_hint.width(); // If the balloon would extend off the screen, push it left or right until it's not const int actual_balloontip_global_x = - std::max(0, std::min(rightmost_valid_balloontip_global_x, target_balloontip_global_x)); + std::max(screen_rect.left(), + std::min(rightmost_valid_balloontip_global_x, target_balloontip_global_x)); // The tip pixel should be in the middle of the control, and arrow_tip_exterior_y is at the bottom // of that pixel. When arrow_at_bottom is true the arrow is above arrow_tip_exterior_y and so the // tip pixel is in the right place, but when it's false the arrow is below arrow_tip_exterior_y |
