src/Pure/GUI/gui.scala
changeset 82568 f35e82124b33
parent 82557 a387b02b5320
child 82626 e840461d5370
equal deleted inserted replaced
82567:26564f433980 82568:f35e82124b33
    22 import com.formdev.flatlaf.FlatLaf
    22 import com.formdev.flatlaf.FlatLaf
    23 
    23 
    24 
    24 
    25 object GUI {
    25 object GUI {
    26   /* Swing look-and-feel */
    26   /* Swing look-and-feel */
    27 
       
    28   def init_laf(): Unit = flatlaf.FlatLightLaf.setup()
       
    29 
    27 
    30   def current_laf(): String = UIManager.getLookAndFeel.getClass.getName()
    28   def current_laf(): String = UIManager.getLookAndFeel.getClass.getName()
    31 
    29 
    32   def is_macos_laf(): Boolean =
    30   def is_macos_laf(): Boolean =
    33     Platform.is_macos && UIManager.getSystemLookAndFeelClassName() == current_laf()
    31     Platform.is_macos && UIManager.getSystemLookAndFeelClassName() == current_laf()
    53     val more_lafs = look_and_feels.map(_.info)
    51     val more_lafs = look_and_feels.map(_.info)
    54     UIManager.setInstalledLookAndFeels((more_lafs ::: lafs).toArray)
    52     UIManager.setInstalledLookAndFeels((more_lafs ::: lafs).toArray)
    55 
    53 
    56     // see https://www.formdev.com/flatlaf/customizing
    54     // see https://www.formdev.com/flatlaf/customizing
    57     UIManager.put("Component.arrowType", "triangle")
    55     UIManager.put("Component.arrowType", "triangle")
       
    56   }
       
    57 
       
    58   def init_laf(): Unit = {
       
    59     init_lafs()
       
    60     flatlaf.FlatLightLaf.setup()
    58   }
    61   }
    59 
    62 
    60 
    63 
    61   /* additional look-and-feels */
    64   /* additional look-and-feels */
    62 
    65