scijava / scijava-ui-swing

SciJava UI components for Java Swing.
BSD 2-Clause "Simplified" License
7 stars 11 forks source link

Add FlatLaf as a L&F option #61

Closed tferr closed 2 years ago

tferr commented 2 years ago

Suggestion for OptionsLookAndFeel:

Swing is for the most part abandonware, but Flatlaf has been making strides in patching several swing limitations, namely lack of consistent scaling in hiDPI screens (which is nasty on Linux). This is mainly an issue for Java 8 (as of today Java11 solves much of it, but it is not perfect. So this would still be relevant once Java11 is adopted).

Some motivations are laid out at the bottom of this comment: https://github.com/scijava/script-editor/pull/56#issuecomment-1050888837

The tasks for this would be:

  1. Adding FlatLaf as dependency
  2. Make sure that initLookAndFeel() returns the FlatLlaf themes (i.e, FlatLightLaf.NAME, FlatIntelliJLaf.NAME, FlatDarkLaf.NAME, FlatDarculaLaf.NAME)
  3. Have run() calling the Flatalaf setup(), something like:
    
    switch (lookAndFeelName) {
        case (FlatLightLaf.NAME):
            success = FlatLightLaf.setup();
            break;
        case (FlatIntelliJLaf.NAME):
            success = FlatIntelliJLaf.setup();
            break;
        case (FlatDarkLaf.NAME):
            success = FlatDarkLaf.setup();
            break;
        case (FlatDarculaLaf.NAME):
            success = FlatDarculaLaf.setup();
            break;
        default:
            (...) // existing logic
        }
imagesc-bot commented 2 years ago

This issue has been mentioned on Image.sc Forum. There might be relevant details there:

https://forum.image.sc/t/shiny-new-script-editor/64160/38