[ToolTip] Base timeout on text length
ClosedPublic

Authored by broulik on Nov 19 2019, 4:20 PM.

Details

Summary

This mimics QToolTip behavior and ensures the tooltip is actually readable. The property naming is quite confusing;

  • delay is the delay until the tooltip shows when visible becomes true
  • timeout is the timeout until the tooltip hides regardless of whether visible is still true! It is not a delay after visible becomes false
Test Plan
  • KScreen rotation button tooltips are readable now

Diff Detail

Repository
R858 Qt Quick Controls 2: Desktop Style
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Nov 19 2019, 4:20 PM
Restricted Application added a project: Plasma. · View Herald TranscriptNov 19 2019, 4:20 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
broulik requested review of this revision.Nov 19 2019, 4:20 PM
ngraham added a reviewer: VDG.Nov 19 2019, 4:25 PM

+1 for fixing the bug

-1 for making it use a length-based calculation. IMO this is a case of being "so smart it's dumb" because it cannot predict user reading speed, take into account non-word-length differences due to translation, etc. Also, it encourages developers to put way too much text in a tooltip. If you can't read a tooltip's text in five or seven seconds, it's too long. I would prefer that we use a hardcoded timeout and them change the QWidgets tooltips duration to follow that.

I would prefer that we use a hardcoded timeout and them change the QWidgets tooltips duration to follow that.

That requires a behavior change in Qt to something that has been like this for decades.

ngraham accepted this revision.Nov 19 2019, 4:32 PM

Ah so it's in Qt itself and not something we do? Oh well, best to at least be consistent, then.

This revision is now accepted and ready to land.Nov 19 2019, 4:32 PM
mart accepted this revision.Nov 22 2019, 12:28 PM
This revision was automatically updated to reflect the committed changes.