summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2024-03-21 03:33:43 +0100
committerGitHub <noreply@github.com>2024-03-21 03:33:43 +0100
commitb19cf1f962971592e9bb50d8a83bc49aafbfd178 (patch)
treed80623ab9216bb2376e2cc3924778059eb31c701 /Source
parent7f1e7314ded2aac05ee933bc11dac3c7abffb89b (diff)
parent647eba36f3bbf8b5e4a6d141bf3c8dc087548cfd (diff)
Merge pull request #12650 from jordan-woyak/balloon-tip-multimon
DolphinQt: Fix BalloonTip positioning on secondary monitors.
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinQt/Config/ToolTipControls/BalloonTip.cpp6
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