add another rollover for the "more prefs" text in the Preferences window

This commit is contained in:
Ben Fry
2022-08-09 15:29:49 -04:00
parent 397c6e375f
commit 8de70e9fb9
2 changed files with 25 additions and 7 deletions
@@ -421,9 +421,26 @@ public class PreferencesFrame {
// More preferences are in the ...
JLabel morePreferenceLabel = new JLabel(Language.text("preferences.file"));
//morePreferenceLabel.setForeground(Color.gray);
morePreferenceLabel.setEnabled(false);
final JLabel morePreferenceLabel = new JLabel(Language.text("preferences.file"));
morePreferenceLabel.setForeground(UIManager.getColor("Label.disabledForeground"));
morePreferenceLabel.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
// Starting in 4.0.1, open the Wiki page about the prefs
Platform.openURL("https://github.com/processing/processing4/wiki/Preferences");
}
// Light this up in blue like a hyperlink
public void mouseEntered(MouseEvent e) {
frame.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
morePreferenceLabel.setForeground(Theme.getColor("laf.accent.color"));
}
// Set the text back to black when the mouse is outside
public void mouseExited(MouseEvent e) {
frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
morePreferenceLabel.setForeground(UIManager.getColor("Label.disabledForeground"));
}
});
JLabel preferencePathLabel = new JLabel(Preferences.getPreferencesPath());
final JLabel clickable = preferencePathLabel;
@@ -441,9 +458,7 @@ public class PreferencesFrame {
// Set the text back to black when the mouse is outside
public void mouseExited(MouseEvent e) {
frame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
// steal the color from a component that doesn't change
// (so that it works after updateTheme() has been called)
clickable.setForeground(sketchbookLocationLabel.getForeground());
clickable.setForeground(UIManager.getColor("Label.foreground"));
}
});
+4 -1
View File
@@ -1,6 +1,9 @@
1286 (4.0.1)
X Changing into p5.js mode gives an error
X https://github.com/processing/processing4/issues/530
X add another rollover for the "more prefs" text in the Preferences window
X open the wiki page on click
X also pull the foreground color from the LaF instead of disabling the label
known issues
@@ -19,7 +22,7 @@ finalizing a release
_ submit to Microsoft
_ https://www.microsoft.com/en-us/wdsi/filesubmission
_ https://aka.ms/wdsi
_ https://www.microsoft.com/security/blog/2018/08/16/partnering-with-the-industry-to-minimize-false-positives/
_ https://www.microsoft.com/security/oblog/2018/08/16/partnering-with-the-industry-to-minimize-false-positives/
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .