Replace all remaining `setStyle` calls with `getStyleClass` except `FontIcon` and `-fx-font-size`
See also the previous issue: https://github.com/JabRef/jabref/issues/15686
We have multiple occurrences where we use setStyle(..) in JabRef. The problem is that this usually hardcodes colors or styles like insets. Therefore, custom themes (CSS) or other stylesheets like Atlanta will always be overwritten by this inline styles.
Additional context
We have styleclasses for that, e.g. bold that should be used. Otherwise a new one can be created.
i am working on this issue
Hi, I've opened PR #15958 which replaces 7 setStyle calls across 5 Java files with getStyleClass().add(...) and adds the corresponding utility classes (.italic, .bold-italic, .small-bold, .cursor-hand, .dialog-header) to jabref-theme.css. I intentionally left 4 calls unchanged as they use dynamic runtime values or have existing comments explaining why a style class is insufficient.
/assign-me
👋 Hey @srinithreddy16, thank you for your interest in this issue! 🎉
We're excited to have you on board. Start by exploring our Contributing guidelines, and set up your local development workspace by following the steps in our workspace setup guidelines to get started smoothly.
For questions on JabRef functionality, you can consult the JabRef Guru. For questions related to the codebase, please start using DeepWiki.
In case you encounter failing tests during development, please check our developer FAQs!
Still facing issues or having more questions? Feel free to ask here on GitHub or on JabRef's Gitter chat. Please don't hesitate to open a (draft) pull request early on to show the direction you are heading towards if unsure.
Happy coding! 🚀
/assign-me
👋 Hey @nhck3001, thank you for your interest in this issue! 🎉
We're excited to have you on board. Start by exploring our Contributing guidelines, and set up your local development workspace by following the steps in our workspace setup guidelines to get started smoothly.
For questions on JabRef functionality, you can consult the JabRef Guru. For questions related to the codebase, please start using DeepWiki.
In case you encounter failing tests during development, please check our developer FAQs!
Still facing issues or having more questions? Feel free to ask here on GitHub or on JabRef's Gitter chat. Please don't hesitate to open a (draft) pull request early on to show the direction you are heading towards if unsure.
Happy coding! 🚀
/assign-me
Thank you for your continued work in JabRef. At this point, you probably already know the basics and the important links. If not, our contributing guidelines is the place you should go to.
At this point in time, you raised 1 pull request(s) of which 0% (0/1) have been merged.
I am working on this issue. PR: #15995
/assign-me
👋 Hey @Eng-YasminKotb, thank you for your interest in this issue! 🎉
We're excited to have you on board. Start by exploring our Contributing guidelines, and set up your local development workspace by following the steps in our workspace setup guidelines to get started smoothly.
For questions on JabRef functionality, you can consult the JabRef Guru. For questions related to the codebase, please start using DeepWiki.
In case you encounter failing tests during development, please check our developer FAQs!
Still facing issues or having more questions? Feel free to ask here on GitHub or on JabRef's Gitter chat. Please don't hesitate to open a (draft) pull request early on to show the direction you are heading towards if unsure.
Happy coding! 🚀
Hi, @Maran23! I started working on this issue but:
I saw that the title mentions FontIcon.setStyle, while the description mentions multiple occurrences where used setStyle(..) in JabRef in general not in specific scope.
I searched the codebase for usages of FontIcon with setStyle but what I could found only one case in InternalMaterialDesignIcon class where a FontIcon uses setStyle dynamically for icon colors.
And yes, I found several other setStyle() usages on different JavaFX components like Label and HBox but, when I checked the previous PRs related to this issue I prefered to make sure I correctly understand the intended scope before opening a PR.
So, could you please clarify:
1.Is the scope of this issue only FontIcon.setStyle() usages or should it cover other static inline setStyle() usages as well?|
2.If the issue is only about FontIcon, should the remaining dynamic color case be changed or is it intentionally kept?
Thanks!
@Eng-YasminKotb I renamed the issue. FontIcon is now excluded because we may replace it at one point. So it is better to ignore it for now and concentrate on the remaining styles.
Most important part which all other PRs overlooked: The goal would be to reduce special style classes and rather combine existing ones e.g. for bold
I want to ask about -fx-padding and -fx-background-color I noticed that changing those will violate the principle of reducing special style as there are different values in two classes for -fx-padding so, Should I replace them as well?
I want to ask about
-fx-paddingand-fx-background-colorI noticed that changing those will violate the principle of reducing special style as there are different values in two classes for-fx-paddingso, Should I replace them as well?
Yes. In this case just create a new styleClass. Give them a good generic name so we could reuse them in the future.
/assign-me
Thank you for your continued work in JabRef. At this point, you probably already know the basics and the important links. If not, our contributing guidelines is the place you should go to.
At this point in time, you raised 1 pull request(s) of which 0% (0/1) have been merged.
We think that this issue was fixed. Please head to https://builds.jabref.org/main to download a development build and try it out.
For any feedback, add a comment to the pull request at https://github.com/JabRef/jabref/pull/16022.