Allow Qt to wrap long tooltips (fixes #1063) #1090

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2012_04_wraptooltips changing 5 files +57 −3
  1. laanwj commented at 3:15 PM on April 13, 2012: member

    Allow Qt to word-wrap tooltips, should fix #1063. Qt can only word-wrap rich text messages.

    Implemented without having to touch any translation: by listening for QEvent::ToolTipChange events, then rewriting the tooltips to prefix <qt/> and convert to rich text if it is not yet rich text.

  2. Diapolo commented at 4:33 PM on April 13, 2012: none

    So <br> can be used in strings for a word-wrap and \n will be replaced by it? Seems like a very good solution. Only question I have left is, if we can set a default width of tooltips.

    Try it with the current version, if you hover the lock-icon if your wallet is encrypted. This is rich text, but looks kind of ugly, because of the small width of the tooltip.

  3. laanwj commented at 4:40 PM on April 13, 2012: member

    I'm not sure where it gets the default width from (which is indeed extremely narrow). Couldn't find any documentation about that. That leaves looking in the Qt source I guess...

  4. Diapolo commented at 4:42 PM on April 13, 2012: none

    But you could verify that the default is to narrow, so this is no Win specific behaviour?

  5. laanwj commented at 5:18 PM on April 13, 2012: member

    No, it isn't specific to any OS. This seems to make the tooltips wider (crazily wide, in this case), for example:

    app.setStyleSheet("QToolTip { min-width: 500px; }");
    
  6. laanwj commented at 5:58 PM on April 13, 2012: member

    I've added a min-width of 350px, this looks like a nice tradeoff between too narrow and too wide.

  7. Diapolo commented at 6:42 PM on April 13, 2012: none

    Tried it and it's way better than before, I agree it's a nice tradeoff until we comeup with a even nicer solution in the future :).

  8. laanwj commented at 6:59 PM on April 13, 2012: member

    Shouldn't worry too much about this, there's way more serious issues to solve first.

  9. gavinandresen commented at 11:41 PM on April 21, 2012: contributor

    ACK

  10. Diapolo commented at 11:26 PM on April 29, 2012: none

    This should get in 0.6.1 as the detach db tooltip is quite long ;).

  11. laanwj commented at 6:40 AM on April 30, 2012: member

    No, I don't think it's a good idea to merge this between release candidates. That's only for critical bugfixes. There's the possibility that this introduces problems in some place / language so it needs testing. Better to merge it after 0.6.1.

  12. Diapolo commented at 8:13 AM on April 30, 2012: none

    It was targetted for 0.6.1 and I reminded of that fact ;). There are quite a few commits that could have been merged in before the RC1.

  13. luke-jr commented at 2:30 AM on May 2, 2012: member

    This makes tooltip windows too wide sometimes: http://luke.dashjr.org/tmp/screenshots/snapshot82.png

  14. laanwj commented at 5:18 AM on May 2, 2012: member

    Yea, it only works if a minimum width is set, otherwise it makes them too narrow. Qt can either size the boxes to the text or the text to the boxes, not both.

  15. Allow Qt to wrap long tooltips (fixes #1063)
    Implemented without having to touch any translation: by listening for QEvent::ToolTipChange events, then rewriting the tooltips to prefix `<qt/>` if it is not yet rich text.
    3793fa09ff
  16. laanwj commented at 8:23 AM on May 5, 2012: member

    Rebased, and added a useful heuristic to only do this for long tooltips, where "long" is defined as longer than a certain length in characters. This fixes @luke-jr's issue.

  17. Diapolo commented at 10:38 AM on May 6, 2012: none

    ACK

  18. laanwj referenced this in commit b8a5e30d91 on May 11, 2012
  19. laanwj merged this on May 11, 2012
  20. laanwj closed this on May 11, 2012

  21. coblee referenced this in commit d7eeb35c82 on Jul 17, 2012
  22. laanwj deleted the branch on Apr 9, 2014
  23. suprnurd referenced this in commit 4d95be602a on Dec 5, 2017
  24. lateminer referenced this in commit d159cb1878 on Dec 25, 2019
  25. dexX7 referenced this in commit db04ceb82c on Mar 12, 2020
  26. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me