demitriusbelai commented on PR #6391:
URL: https://github.com/apache/netbeans/pull/6391#issuecomment-1732186956

   > how does this behave on other systems, do the window decoration changes 
take immediate effect when the option is applied?
   
   On Windows it do not need restart.
   
   > we should probably trigger the restart notification bubble (this might 
need a isLinux() check if the restart is unique to linux):
   
   My fault. NetBeans was already asking for restart but now I know it is a bug 
when AccentColor is set DEFAULT. I will try to explain.
   
   When AccentColor is set DEFAULT, it is saved as 'null'. So NetBeans launch 
FlatLatOptionsPanel:
   
   * the static variable currentAccentColor is NULL
   * getPrefsAccentColorOrDefault() returns DEFAULT
   * accentColorField.setSelectedColor(getPrefsAccentColorOrDefault()) => 
DEFAULT
   
   When store():
   
   * accentColor = accentColorField.getSelectedColor() => DEFAULT
   * accentColor is always not equals currentAccentColor (DEFAULT != null), 
then it always trigger askForRestart() when FlatLafPanel is changed.
   
   It can be fixed:
   
   ```diff
   diff --git 
a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLafOptionsPanel.java
 
b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLafOptionsPanel.java
   index 9c47c6c60e..da5eaca8d8 100644
   --- 
a/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLafOptionsPanel.java
   +++ 
b/platform/o.n.swing.laf.flatlaf/src/org/netbeans/swing/laf/flatlaf/FlatLafOptionsPanel.java
   @@ -53,7 +53,7 @@ import org.openide.util.RequestProcessor;
    public class FlatLafOptionsPanel extends javax.swing.JPanel {
    
        private static final Color DEFAULT = new Color(0, true);
   -    private static final Color currentAccentColor = 
FlatLafPrefs.getAccentColor();
   +    private static final Color currentAccentColor = 
FlatLafPrefs.getAccentColor() != null ? FlatLafPrefs.getAccentColor() : DEFAULT;
    
        private static final RequestProcessor RP = new 
RequestProcessor(FlatLafOptionsPanel.class);
   ```
   
   As soon as possible I will fix the PR.


-- 
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