eirikbakke commented on code in PR #5795:
URL: https://github.com/apache/netbeans/pull/5795#discussion_r1163406496


##########
platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/Installer.java:
##########
@@ -53,6 +53,10 @@ public void validate() throws IllegalStateException {
             FlatLaf.registerCustomDefaultsSource(customFolder.toURL());
         }
 
+               FlatLaf.setSystemColorGetter( name -> {
+                       return name.equals( "accent" ) ? 
FlatLafPrefs.getAccentColor() : null;
+               } );

Review Comment:
   Some more tabs instead of spaces here...



##########
platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLafPrefs.java:
##########
@@ -35,6 +37,28 @@ class FlatLafPrefs {
 
     private static final Preferences prefs = 
NbPreferences.forModule(FlatLafPrefs.class);
 
+       static Color getAccentColor() {
+        return parseColor(prefs.get(ACCENT_COLOR, null));
+       }
+
+       static Color parseColor(String s) {
+        try {
+            return (s != null && s.startsWith("#")) 
+                    ? new Color(Integer.parseInt(s.substring(1), 16)) 
+                    : null;
+        } catch (NumberFormatException ex) {
+            return null;
+        }
+       }

Review Comment:
   Some more tabs instead of spaces here...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to