From 60a70528686dc690d1c364819d5cef994334a29b Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Wed, 9 Feb 2022 22:51:27 -0800 Subject: [PATCH] Fix volume control tooltip appearance on the left Increasing the threshold for the width of the tooltip to the right of its intended location to a more generous value, makes it appear on the left side sooner rather than later, but should fix positioning issues. Fixes #226 Signed-off-by: Christopher Snowhill --- Window/VolumeSlider.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Window/VolumeSlider.m b/Window/VolumeSlider.m index 50a866800..b2ac2a9f4 100644 --- a/Window/VolumeSlider.m +++ b/Window/VolumeSlider.m @@ -74,7 +74,7 @@ NSWindow *window = self.window; NSPoint screenPoint = [window convertPointToScreen:NSMakePoint(width + 1, height + 1)]; - if(window.screen.frame.size.width < screenPoint.x + textView.bounds.size.width + 24) // wing it + if(window.screen.frame.size.width < screenPoint.x + textView.bounds.size.width + 64) // wing it [popover showRelativeToRect:NSMakeRect(1, height, 2, 2) ofView:self preferredEdge:NSRectEdgeMinX]; else [popover showRelativeToRect:NSMakeRect(width, height, 2, 2) ofView:self preferredEdge:NSRectEdgeMaxX]; @@ -90,6 +90,8 @@ - (void)showToolTipForView:(NSView *)view closeAfter:(NSTimeInterval)duration { [self updateToolTip]; + [popover showRelativeToRect:view.bounds ofView:view preferredEdge:NSRectEdgeMaxY]; + [self hideToolTipAfterDelay:duration]; }