-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Html code in the tooltip of the search field #3381
Comments
Hey, I looked into this issue and would be glad to take it. It's possible to display a WebView inside the Tooltip which renders the HTML as a graphic. Or was there any other solution intended? Does anyone know why the background of the search field tooltip is black-ish? Shouldn't it be grey or light blue? Seems strange to me and I couldnt find out why. This is my first approach to contribute in an open source project, i already read your contributing guide. Is there something else to consider? |
As user I would expect plain text with proper line break |
It would be text, but with the possibility to make some words e.g. bold |
Hi, thanks for your interest in this issue. Both javafx and swing support html toolips out of the box. Some General Tipps for contributing, make sure to set up your IDE accordingly so that you have the code formatter rules we use. |
I think you should use the html option, to make sure the author names are shown correctly |
@jupf Thanks for your interest in contributing! JavaFX actually does not support HTML in its controls and I think this is a good design. Instead of using a webview (which would work in principle), JavaFX introduced the TextFlow to support rich text.
TextFlow instead of String . Note that as a consequence of this the search/rules/describer/ package should move to gui instead. If you feel not yet comfortable enough to do this refactoring, it is no problem - we can help you with it or take over this final step.If you have any questions, feel free to ask them here (or open a PR with your initial progress). |
Okay, I will open a PR as soon as there is progress to discuss |
@jupf Any updates on this? |
I have a few open questions after making the main changes proposed from @tobiasdiez. I detailed them in the pull request. Sorry this took so long |
* the SearchDescribers now return a TextFlow * moved the search.rules.describer package from logic to gui package because the SearchDescriber now creates TextFlow Elements * moved the tests accordingly * modified creation of Tooltip in GlobalSearchBar to display the TextFlow created by the SearchDescribers * SearchQuery now stores a TextFlow as description * Added a stub for compatibility in GroupDialog because it uses the SearchQuery to get the description and needs an HTML string for its Swing Tooltip * Styled the SearchBar Tooltip for readability It uses an own style class to not change any other styled elements. Styling was choosen to look like the other (swing) tooltips. * refactor for better readability * removed description member of SearchQuery class because the description of a SearchQuery is a gui element, it is not stored any more in this class. Everywhere the description is needed it is generated * add method to create HTML string from javafx Text * create HTML string from description for compat. * fixed formatting for style * created tests for TextUtil class * modified the SearchDescriber Implementations tests now they work properly again and check the created Texts inside the description TextFlow * split up testcases into single methods * using old localized strings again these old localized strings containing html tags are broken up and converted to Text objects to use in javafx TextFlow * added and modified tests * added changelog entry * changed syntax for getting SearchDescriber now a whole SearchQuery object is sufficient to get a corresponding SearchDescriber * refactored for better style * javafx tooltips styled per css also refactored the GlobalSearchBar tooltip to use this new styling * modified and restructured tests It was necessary to modify the tests of the SearchDescriber Implementations and the TooltipTextUtil class because of the new css styling for tooltips. Also refactored for better style
This should be fixed in the latest development version thanks to @jupf. Could you please check the build from http://builds.jabref.org/master/. Thanks! |
There is html code in the tooltip of the search field (click to enlarge the screenshot)
The text was updated successfully, but these errors were encountered: