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

Fix tooltips appearing too large and/or away from the cursor #4920

Merged
merged 3 commits into from
Nov 4, 2023

Conversation

Nerixyz
Copy link
Contributor

@Nerixyz Nerixyz commented Oct 26, 2023

Description

How to reproduce:

  1. Enable link previews.
  2. Send anyway https://clips.twitch.tv/HeartlessShinyJuiceMingLee and https://livestreamfails.com/post/30495 in chat.
  3. Resize the window, so both links appear above each other.
  4. Move the mouse between the links.
  5. Notice the tooltip appearing really large for a frame or two (this often happens when hovering really fast between the links).
  6. Notice the tooltip not appearing above the cursor (this often happens when hovering slow).

This PR fixes the issue by recalculating the size of the widgets if it's unexpected and refreshing when an image gets loaded (rather than every 100ms). Furthermore, it avoids any work if the window isn't visible.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

src/widgets/TooltipWidget.cpp Show resolved Hide resolved
@pajlada pajlada enabled auto-merge (squash) November 4, 2023 17:54
@pajlada pajlada merged commit 5325c7b into Chatterino:master Nov 4, 2023
15 checks passed
@Nerixyz Nerixyz deleted the fix/tooltip-party branch November 4, 2023 18:15
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