-
-
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
Remove dependency to jgoodies-looks #3458
Conversation
MetalLookAndFeel.setCurrentTheme(new SkyBluer()); | ||
com.jgoodies.looks.Options.setPopupDropShadowEnabled(true); | ||
UIManager.setLookAndFeel(lnf); | ||
UIManager.setLookAndFeel(new NimbusLookAndFeel()); |
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.
you should set the LookAndFeel based on className, as recommend by the jdk api:
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
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 pointing out! Changed it.
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.
The code looks good to me. I have one suggestion that you might want to consider.
@@ -60,8 +60,6 @@ | |||
public static Set<String> getAvailableLookAndFeels() { | |||
|
|||
Set<String> lookAndFeels = new HashSet<>(); | |||
lookAndFeels.add("com.jgoodies.looks.plastic.Plastic3DLookAndFeel"); | |||
lookAndFeels.add("com.jgoodies.looks.windows.WindowsLookAndFeel"); | |||
|
|||
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { |
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.
I think the rest of the method can now be replaced by the one-liner return getInstalledLookAndFeels().stream().map(LookAndFeelInfo:getClassName).collect(toSet)
?
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.
Not exactly (it's and array), but almost: Arrays.stream(UIManager.getInstalledLookAndFeels()).map(LookAndFeelInfo::getClassName).collect(Collectors.toSet())
Can't incorporating this new L&F in 4.1 give us a huge user-base to test? 4.1 will be a release with christmas colors and then we will release 4.2 somewhere around 6th january with the default colors again. - Hoping that this works with the new color configuration ^^. |
This is how JabRef looks after upgrading: @LinusDietz could you provide a Linux screenshot? |
To be honest, I wouldn't spend to much time on swing look and feels. They disappear as soon as we finish migrating (most) of the ui to JavaFX. |
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.
Yeah, no issues on Windows. Seems we have to wait for a Screenshot of a Linux person and then we can merge it!
@@ -466,12 +466,12 @@ private JabRefPreferences() { | |||
defaults.put(WIN_LOOK_AND_FEEL, UIManager.getSystemLookAndFeelClassName()); | |||
defaults.put(EMACS_PATH, "emacsclient"); | |||
} else if (OS.WINDOWS) { | |||
defaults.put(WIN_LOOK_AND_FEEL, "com.jgoodies.looks.windows.WindowsLookAndFeel"); | |||
defaults.put(WIN_LOOK_AND_FEEL, "com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); |
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.
According to https://bugs.openjdk.java.net/browse/JDK-8136366, this is a non-public L&F. But reading along, it seems, we are "correctly" using it...
@koppor: For me JabRef looked like this all the time ;-) I have been using the windows landf all along. The big difference in look might rather be on Linux. |
Since 4.1 is released, we can merge this as agreed. |
Jgoodies-looks uses internal APIs (see #2594 (comment) ), which means that it causes problems with Java 9. This PR removes this dependency. The biggest change is that two Look and Feels go and that particularily affects Linux users.
I have used the Nimbus Look and Feel as the new default for Linux, but we can change that or even search for better Java 9-compatible Look and Feels. I have also added a preferences migration in case a user has set one of the incompatible Look and Feels.
I would suggest that we wait with merging this after we have release 4.1. Java 9 does not yet matter for 4.1 and we should give the Linux users a stable JabRef that still has the old Look and Feels before moving on.
gradle localizationUpdate
?