Skip to content

Commit

Permalink
add another rollover for the "more prefs" text in the Preferences window
Browse files Browse the repository at this point in the history
  • Loading branch information
benfry committed Aug 9, 2022
1 parent 397c6e3 commit 8de70e9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
27 changes: 21 additions & 6 deletions app/src/processing/app/ui/PreferencesFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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"));
}
});

Expand Down
5 changes: 4 additions & 1 deletion todo.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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/


. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Expand Down

0 comments on commit 8de70e9

Please sign in to comment.