Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle tooltip comments of overlapping annotations #228

Closed
wants to merge 1 commit into from

Conversation

daniestevez
Copy link
Contributor

@daniestevez daniestevez commented Oct 10, 2023

This handles the tooltips displaying the comments of overlapping annotations, as long as only one of the annotations that contain the mouse cursor has a tooltip.

Before, SpectrogramPlot::getAnnotationComment() would return the comment of the first annotation that contains the mouse cursor, even if such a comment is an empty QString. The empty QString would cause that no tooltip is displayed. Now SpectrogramPlot::getAnnotationComment() only returns non-empty comments. Therefore, if only one annotation with a comment contains the mouse cursor, the tooltip for that comment will be displayed.

This still does not handle the case when multiple annotations with comments contain the mouse cursor, since it is not clear what is best to do in this case. For now, SpectrogramPlot::getAnnotationComment() simply returns one of the applicable comments.

This handles the tooltips displaying the comments of overlapping
annotations, as long as only one of the annotations that contain
the mouse cursor has a tooltip.

Before, SpectrogramPlot::getAnnotationComment() would return the
comment of the first annotation that contains the mouse cursor,
even if such a comment is an empty QString. The empty QString
would cause that no tooltip is displayed. Now
SpectrogramPlot::getAnnotationComment() only returns non-empty
comments. Therefore, if only one annotation with a comment contains
the mouse cursor, the tooltip for that comment will be displayed.

This still does not handle the case when multiple annotations with
comments contain the mouse cursor, since it is not clear what is
best to do in this case. For now,
SpectrogramPlot::getAnnotationComment() simply returns one of the
applicable comments.

Signed-off-by: Daniel Estévez <daniel@destevez.net>
@miek
Copy link
Owner

miek commented Oct 16, 2023

Merged, thanks!

@miek miek closed this Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants