-
Notifications
You must be signed in to change notification settings - Fork 823
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
Fix POM Graph colors for dark themes #5391
Conversation
hi @johntor, thanks for working on this. it certainly does look much better and I agree the gradients have to go given that NetBeans is using a theme called Flat LAF by default :) However, I still see problems with FlatLAF dark, what theme are you using since your screenshorts show white font on dark background. |
I did not notice all these! If you like the idea of the removed gradients we can optimize the code more. |
@johntor would be great. Simply force push into this PR if you want to make changes. I believe the font color might need to be hard coded if the custom (non-standard) background fill of the text element is active - otherwise there gonna be always some theme which will clash. |
Yes I was thinking determining if the theme is light/dark then apply fixed black/white colors for fonts |
if the background is taken from the theme, its ok to take the font color from the theme too. But as soon the background is changed, for example when set to orange, the color can't be taken from the theme anymore - it has to fit to the orange background. I wouldn't hardcode all font colors, only conditional when the background actually changes. |
Yes, two hard coded colours for each pallette option based on value of |
i don't think any of this needs to know if the dark theme is active or not if it follows the simple rule of changing both, foreground and background at the same time but never only one of them while leaving the other to the theme. |
Then we have problems to apply your light-grey text over orange or yellow. I will go with the hardcoded solution and we see how it goes... |
why would you do that? I am trying to say that if you change the background to orange, you have to change the text to a fitting color too, so that it is readable on orange. You can't leave the text color up to the theme and hope it will still work. |
you have now two commits, I think the easiest option in this particular case is to remove the last commit again with:
This will only remove the commit, the changes you made will remain in the source code. Now you can simply commit with NetBeans again but check the (the same command from the console would be To replace the remote
|
You create a palette of background colours that works with black-ish text, and one that works with white-ish text. Working on something similar with the visual library myself at the moment. However, this fix looks good for now. If we can get it amended and force pushed as above, we can merge later today for 17-rc3. |
If the background would be theme aware - the foreground must be theme aware too, I agree. But in this particular case the background fill colors (red/orange) already work with dark/light themes, additionally to that the boxes have an outline which is controlled by the theme - which makes it extra resistant to clash with theme colors. So the main problem here was that some boxes set the background fill without setting the font color. That is the reason I said I do not think the logic has to be aware of the theme at all - it only has to follow the rule to not pick the foreground from a theme color while hard coding the background. The visual for "Scopes" will need more work since it used to be a gradient but this is outside the scope of this PR :) (I don't think it will look good in any color the way it is currently rendered as simple box in a box) |
I think current solution is simple and efficient for any color theme. Keep in mind the new feature of changing the colors of Flat Laf. This solution is adaptioning theme colors while keeping original colors with BLACK foreground to boxes with background yellow orange and red. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you revert the formatting changes you did in the most recent commit We try to avoid unrelated changes in PRs which fix things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this patch! I'm fine with this patch as long as it is tested well on both light and dark FlatLAF modes.
A general comment for future PRs is to try to keep the patches free of unnecessary formatting changes; this makes them easier to review. If you'd like to clean up formatting, it's good to do all the formatting changes in a single commit.
(A side note for @neilcsmith-net: aren't "release candidate" versions supposed to be very stable, with only critical bugfixes going into them? Patches like these benefit from being tested for a few weeks in dev environments before going into production.)
java/java.graph/src/org/netbeans/modules/java/graph/NodeWidget.java
Outdated
Show resolved
Hide resolved
java/java.graph/src/org/netbeans/modules/java/graph/NodeWidget.java
Outdated
Show resolved
Hide resolved
java/java.graph/src/org/netbeans/modules/java/graph/NodeWidget.java
Outdated
Show resolved
Hide resolved
java/java.graph/src/org/netbeans/modules/java/graph/NodeWidget.java
Outdated
Show resolved
Hide resolved
java/java.graph/src/org/netbeans/modules/java/graph/NodeWidget.java
Outdated
Show resolved
Hide resolved
java/java.graph/src/org/netbeans/modules/java/graph/NodeWidget.java
Outdated
Show resolved
Hide resolved
@eirikbakke well the colors and gradients were borderline unreadable before, so the bar is lower here for a hotfix. This is only a UI change which removes gradients and tweaks colors so it has low risk to cause trouble. I agree with the formatting changes which were added by the second commit - those should be reverted. |
@mbien Yeah, I trust your judgment here. (I just remember having made "cosmetic-only" patches like this myself only to find I introduced a NullPointerException somewhere a week later...) |
I am sorry that I have no time to completed this Pull Request till the end right now... (busy at work) |
Bug fixes until rc3, only critical fixes afterwards - https://lists.apache.org/thread/hyjbsz55zb9xfcnccghkrsvqsnt83nwf Yes, there are risks to lower priority fixes, but it's worth it to improve the release experience IMO. |
@johntor no worries. I can take over. Will remove the formatting changes and force push into this PR. Thanks for your work! This might add me as co author to the commit. Lets see how this works. |
Co-authored-by: Michael Bien <mbien42@gmail.com>
squashed, reverted formatting and force pushed |
@eirikbakke @neilcsmith-net I am willing to accept this one as my side quest, if it causes followup problems assign issues to me. |
@johntor congrats on your first contribution. |
Thank you very much! I thought contributing to a complicated project like Netbeans is too difficult... I realized that I was wrong! I will be back! Take care! |
I noticed a problem using the Graph of a POM when a dark theme is selected.
The foreground color was requested from the Theme while backgrounds are hardcoded into the Class causing printing WHITE on Bright Colors.
With this fix I added transparency to these hardcoded colors so the become darker on darker backgrounds.
I also removed gradients that looked a bit outdated to my eyes.