No more linebreaks in tooltips ?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
No more linebreaks in tooltips ?
Hello,
I was successfully using line breaks in tooltips before :
https://github.com/tomate44/CurvesWB/bl ... es.py#L238
They are now ignored :
Is there a way to get them back ?
I was successfully using line breaks in tooltips before :
https://github.com/tomate44/CurvesWB/bl ... es.py#L238
They are now ignored :
Is there a way to get them back ?
Re: No more linebreaks in tooltips ?
Hi chris, probably my fault. New tooltips are created here: https://github.com/FreeCAD/FreeCAD/blob ... d.cpp#L855.
Current tooltip text ('ToolTip':) should not contain the command title, that is obtained through 'MenuText'.
Anyway the new function is not supposed to remove the line breaks...
Current tooltip text ('ToolTip':) should not contain the command title, that is obtained through 'MenuText'.
Anyway the new function is not supposed to remove the line breaks...
follow my experiments on BIM modelling for architecture design
Re: No more linebreaks in tooltips ?
Oh, could you try to use <br> instead of \n ?
follow my experiments on BIM modelling for architecture design
Re: No more linebreaks in tooltips ?
<br> is working, thanks.
Re: No more linebreaks in tooltips ?
Great! I was lucky
sorry for the annoyance of having to rework your tooltips
sorry for the annoyance of having to rework your tooltips
follow my experiments on BIM modelling for architecture design
Re: No more linebreaks in tooltips ?
No problem, they will be nicer like that
Re: No more linebreaks in tooltips ?
How did i miss this thread?
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: No more linebreaks in tooltips ?
Changing linebreaks to "<br>" does come with some issues:
Some workbenches (TechDraw) use the tooltip texts for the statusbar texts as well. Having "<br>" instead of "\n" in the text is then a problem. In the statusbar "\n" becomes a space, but "<br>" appears as is.
If the tooltip text contains multiple spaces (for indentation) those spaces are lost when "<br>" occurs in the text. You would have to replace them with " ".
Tooltip texts converted to "<br>" have to be re-translated.
Related:
https://forum.freecadweb.org/viewtopic.php?f=10&t=65612
Some workbenches (TechDraw) use the tooltip texts for the statusbar texts as well. Having "<br>" instead of "\n" in the text is then a problem. In the statusbar "\n" becomes a space, but "<br>" appears as is.
If the tooltip text contains multiple spaces (for indentation) those spaces are lost when "<br>" occurs in the text. You would have to replace them with " ".
Tooltip texts converted to "<br>" have to be re-translated.
Related:
https://forum.freecadweb.org/viewtopic.php?f=10&t=65612
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: No more linebreaks in tooltips ?
Python workbenches still need to support users with the latest stable 0.19, which means this string replacement "\n" to "<br/>" has to be done, but only if the version is >= 0.20. Could be better if FreeCAD did this replacement automatically?
Re: No more linebreaks in tooltips ?
I think this could be good, but i think chris_g for example already replaced his tooltips in Curves...TheMarkster wrote: ↑Wed Feb 02, 2022 3:07 am Python workbenches still need to support users with the latest stable 0.19, which means this string replacement "\n" to "<br/>" has to be done, but only if the version is >= 0.20. Could be better if FreeCAD did this replacement automatically?
I Guess this is all mainly caused because i used the <h3> formatting of the header of the tooltips. It looks good, but perhaps this Is a change that can be reverted without a big lossRoy_043 wrote: ↑Tue Feb 01, 2022 9:26 am Changing linebreaks to "<br>" does come with some issues:
Some workbenches (TechDraw) use the tooltip texts for the statusbar texts as well. Having "<br>" instead of "\n" in the text is then a problem. In the statusbar "\n" becomes a space, but "<br>" appears as is.
If the tooltip text contains multiple spaces (for indentation) those spaces are lost when "<br>" occurs in the text. You would have to replace them with " ".
Tooltip texts converted to "<br>" have to be re-translated.
Related:
https://forum.freecadweb.org/viewtopic.php?f=10&t=65612
follow my experiments on BIM modelling for architecture design