From 8de70e9fb9942c6438a9e78185741582fc2f41db Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Tue, 9 Aug 2022 15:29:49 -0400 Subject: [PATCH] add another rollover for the "more prefs" text in the Preferences window --- .../processing/app/ui/PreferencesFrame.java | 27 ++++++++++++++----- todo.txt | 5 +++- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/app/src/processing/app/ui/PreferencesFrame.java b/app/src/processing/app/ui/PreferencesFrame.java index 1340bba83d..d4e7818fdd 100644 --- a/app/src/processing/app/ui/PreferencesFrame.java +++ b/app/src/processing/app/ui/PreferencesFrame.java @@ -421,9 +421,26 @@ public void mouseExited(MouseEvent e) { // 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 void mouseEntered(MouseEvent e) { // 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")); } }); diff --git a/todo.txt b/todo.txt index 93fe6eebae..2ce03f555e 100755 --- a/todo.txt +++ b/todo.txt @@ -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/ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .