Improve thumbnail tooltip animation
ClosedPublic

Authored by huoni on Feb 21 2018, 1:05 AM.

Details

Summary

This fixes a cosmetic issue where the tooltip got 'stuck' as long as you
kept moving your mouse around. The trade-off is it more often than not
fades out quicker than it did before, but I believe this isn't a problem.

This prevents the tooltip fade-out animation getting the 500ms delay unless the current animation is not running.
Therefore preventing the animation perpetually gaining a delay if moving the mouse over thumbnails fast enough.

BUG: 245091

Before:

After:

Diff Detail

Repository
R260 Gwenview
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
huoni requested review of this revision.Feb 21 2018, 1:05 AM
huoni created this revision.
huoni edited the summary of this revision. (Show Details)Feb 21 2018, 1:07 AM
rkflx accepted this revision.Feb 21 2018, 8:10 PM
rkflx added a subscriber: rkflx.

+2, this was really annoying.


Looking at https://bugs.kde.org/buglist.cgi?quicksearch=gwenview%20tooltip, you might add a BUG: to your summary…

Also, this could go to Applications/17.12, don't you think? Rebase if you agree.

Tip for your next summary: Describe on a higher level (but lower than what the user sees) what was wrong with the code itself and how you fixed it. This would make reviewing a little bit easier/faster, because I would not have to come up with what the code is supposed to be doing and why the change is the correct one.

lib/thumbnailview/previewitemdelegate.cpp
60–61

If at all this should read cstdio, but I don't see why you would need both lines ;)

For debugging, just use qDebug () << "text" << variable;, for some types there are even nice pretty-printers.

https://doc.qt.io/qt-5/qdebug.html
https://doc.qt.io/qt-5/qloggingcategory.html
https://community.kde.org/Guidelines_and_HOWTOs/Debugging/Using_Error_Messages#Qt_5_.2F_KDE_Frameworks_5

482–484

((…))(…)

This revision is now accepted and ready to land.Feb 21 2018, 8:10 PM
huoni updated this revision to Diff 27739.Feb 21 2018, 11:13 PM
huoni marked 2 inline comments as done.
  • Remove unnecessary code, code cleanup
  • Branch off Applications/17.12

Looking at https://bugs.kde.org/buglist.cgi?quicksearch=gwenview%20tooltip, you might add a BUG: to your summary…

Did search, but missed that relevant bug. Will add.

Also, this could go to Applications/17.12, don't you think? Rebase if you agree.

Sure, will do.

Tip for your next summary: Describe on a higher level (but lower than what the user sees) what was wrong with the code itself and how you fixed it. This would make reviewing a little bit easier/faster, because I would not have to come up with what the code is supposed to be doing and why the change is the correct one.

Also will do.

lib/thumbnailview/previewitemdelegate.cpp
60–61

Damn, left those in! Thanks for the tip with debugging, hadn't actually bothered to research that... :/

482–484

Ugh, another one left over from all the testing I did.

huoni edited the summary of this revision. (Show Details)Feb 21 2018, 11:15 PM
huoni edited the summary of this revision. (Show Details)
rkflx accepted this revision.Feb 22 2018, 1:34 PM

Tip for your next summary

You nailed it.

lib/thumbnailview/previewitemdelegate.cpp
41–42

Oops, I missed to catch that…

This revision was automatically updated to reflect the committed changes.