Changeset 36128 in osm for applications/editors


Ignore:
Timestamp:
2023-09-06T22:40:20+02:00 (13 months ago)
Author:
taylor.smock
Message:

Update FlatLaf to 3.2 from 2.6

  • New macOS-style themes
  • Set apple.awt.application.appearance on macOS systems so title bar matches system settings
Location:
applications/editors/josm/plugins/flatlaf
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/flatlaf/ivy.xml

    r36034 r36128  
    22  <info organisation="org.openstreetmap.josm.plugins" module="flatlaf"/>
    33  <dependencies>
    4     <dependency conf="default->default" org="com.formdev" name="flatlaf" rev="2.6"/>
     4    <dependency conf="default->default" org="com.formdev" name="flatlaf" rev="3.2"/>
    55  </dependencies>
    66</ivy-module>
  • applications/editors/josm/plugins/flatlaf/src/org/openstreetmap/josm/plugins/flatlaf/FlatLafPlugin.java

    r35572 r36128  
    66import org.openstreetmap.josm.plugins.Plugin;
    77import org.openstreetmap.josm.plugins.PluginInformation;
     8import org.openstreetmap.josm.tools.PlatformManager;
     9import org.openstreetmap.josm.tools.Utils;
    810
    911import com.formdev.flatlaf.FlatDarculaLaf;
     
    1214import com.formdev.flatlaf.FlatLaf;
    1315import com.formdev.flatlaf.FlatLightLaf;
     16import com.formdev.flatlaf.themes.FlatMacDarkLaf;
     17import com.formdev.flatlaf.themes.FlatMacLightLaf;
    1418
    1519/**
     
    2630        super(info);
    2731        UIManager.getDefaults().put("ClassLoader", getClass().getClassLoader());
    28         UIManager.installLookAndFeel("FlatLaf Darcula", FlatDarculaLaf.class.getName());
    29         UIManager.installLookAndFeel("FlatLaf Dark", FlatDarkLaf.class.getName());
    30         UIManager.installLookAndFeel("FlatLaf IntelliJ", FlatIntelliJLaf.class.getName());
    31         UIManager.installLookAndFeel("FlatLaf Light", FlatLightLaf.class.getName());
     32        // Load the built-in themes
     33        FlatDarculaLaf.installLafInfo();
     34        FlatDarkLaf.installLafInfo();
     35        FlatIntelliJLaf.installLafInfo();
     36        FlatLightLaf.installLafInfo();
     37        FlatMacDarkLaf.installLafInfo();
     38        FlatMacLightLaf.installLafInfo();
    3239
    3340        // enable loading of FlatLaf.properties, FlatLightLaf.properties and FlatDarkLaf.properties from package
    3441        FlatLaf.registerCustomDefaultsSource("org.openstreetmap.josm.plugins.flatlaf", getClass().getClassLoader());
     42        if (PlatformManager.isPlatformOsx() && Utils.getSystemProperty("apple.awt.application.appearance") == null) {
     43            // See https://www.formdev.com/flatlaf/macos/
     44            // This makes the title bar match the system settings
     45            Utils.updateSystemProperty("apple.awt.application.appearance", "system");
     46        }
    3547    }
    3648
Note: See TracChangeset for help on using the changeset viewer.