jDiskMark / jdm-java

1 stars 0 forks source link

update look and feel #12

Open jamesmarkchan opened 9 months ago

jamesmarkchan commented 9 months ago

The current look and feel is Nimbus which is a unique crossplatform LAF to swing. Unfortunately Nimbus and Metal the two cross platform LAFs are a little dated and it would be good to take advantage of the newer streamlined alternatives. NetBeans 20 is using FlatLightLaf which is more consistant with the current windows LAF.

https://central.sonatype.com/artifact/com.formdev/flatlaf

            try {
                UIManager.setLookAndFeel(new FlatLightLaf()); // Light theme
                // Or: UIManager.setLookAndFeel(new FlatDarkLaf()); // Dark theme
                flatLafFound = true;
            } catch (UnsupportedLookAndFeelException e) {
                Logger.getLogger(App.class.getName()).log(Level.SEVERE, null, e);
            }

Good to identify target look and feels for Mac OS and Ubuntu Gnome / Linux.

jamesmarkchan commented 9 months ago

FlatLightLaf() creates this: flatlaf-light-jdm some nice things about this is no use of gradients and the if you have few menus like we do the title and menus share the same strip at the top.

jamesmarkchan commented 9 months ago

Grrrrr, we're going to have to do some adjustments to use GTK's LAF: UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); Screenshot from 2024-02-04 02-14-20

jamesmarkchan commented 9 months ago

yeah using flat light on linux and windows is going to be a headache they have different alignment rules and spacing. Here was how it looked before the linux tweaks. flat-light-laf-win-opt and there is after the linux tweaks. flat-light-after-linux-opt-on-win i think we can use flat light on windows and nimbus on linux for the time being.

jamesmarkchan commented 3 months ago

Screenshot of buttons moved down on windows image

jamesmarkchan commented 3 months ago

Nimbus layout on Linux image