rkeen-siemens opened a new issue, #5265:
URL: https://github.com/apache/netbeans/issues/5265

   ### Apache NetBeans version
   
   Apache NetBeans 16
   
   ### What happened
   
   The new feature to allow customizing FlatLaf is nice, but when changing the 
font _and_ changing the font size the new font is not used for file chooser 
file list and details views.
   
   ### How to reproduce
   
   1. Choose Tools > Options > Appearance > FlatLaf
   2. In the Advanced section, click the Edit custom properties button
   3. Close the options dialog and add a line to FlatLaf.properties (which 
should now be open in the editor) to change the default font (e.g. `defaultFont 
= "Nanum Brush Script"`)
   4. Save the file and close NetBeans
   5. Launch NetBeans again with a custom font size (e.g. `./bin/netbeans 
--fontsize 24`). You'll see the UI has changed to use the new font as expected
   6. Choose File > Open File...
   
   The file chooser dialog that appears uses the selected font for most of the 
UI, but the file list and detail views use the standard sans serif font rather 
than the new font.
   
   
![WrongFont](https://user-images.githubusercontent.com/46196614/211664553-87da8e31-0516-4e5b-af53-a55cfbd52fe0.png)
   
   If you launch NetBeans without overriding the font size, the file chooser 
uses the correct font.
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Windows 10 Pro, CentOS 7.6 with Gnome 3
   
   ### JDK
   
   Java 17.0.4.1
   
   ### Apache NetBeans packaging
   
   Apache NetBeans provided installer
   
   ### Anything else
   
   I suspect this is due to the logic in `AllLFCustoms.initCustomFontSize` 
where it [resizes the existing font for 
"FileChooser.listFont"](https://github.com/apache/netbeans/blob/cd14cf5e66279e1b0d7627d8476d5f2301fa692a/platform/o.n.swing.plaf/src/org/netbeans/swing/plaf/AllLFCustoms.java#L127)
 (and others). The problem is that at this point there is no value set for some 
of the settings including "FileChooser.listFont", "OptionPane.messageFont", and 
"windowTitleFont" and they are then assigned the default Dialog font.
   
   Some possible solutions:
   1. If the setting doesn't yet exist, don't set it (since it will be picked 
up from an existing setting, at least [in the case of 
"FileChooser.listFont"](https://github.com/openjdk/jdk17u/blob/41c9d7dc572340e80f46bc40bd673cc2c14ec3e1/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java#L890)).
   2. Set the default values from FlatLaf settings, either "defaultFont" or 
"monospaced.font" and only fallback to the hard coded values if those don't 
exist
   
   ### Are you willing to submit a pull request?
   
   Yes
   
   ### Code of Conduct
   
   Yes


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