16 RootPaneContainer, JTextField, JComboBox, LookAndFeel, UIManager, SwingUtilities} |
16 RootPaneContainer, JTextField, JComboBox, LookAndFeel, UIManager, SwingUtilities} |
17 |
17 |
18 import scala.swing.{CheckBox, ComboBox, ScrollPane, TextArea, ListView, Separator} |
18 import scala.swing.{CheckBox, ComboBox, ScrollPane, TextArea, ListView, Separator} |
19 import scala.swing.event.{ButtonClicked, SelectionChanged} |
19 import scala.swing.event.{ButtonClicked, SelectionChanged} |
20 |
20 |
|
21 import com.formdev.flatlaf |
|
22 import com.formdev.flatlaf.FlatLaf |
|
23 |
21 |
24 |
22 object GUI { |
25 object GUI { |
23 /* Swing look-and-feel */ |
26 /* Swing look-and-feel */ |
24 |
27 |
25 def init_laf(): Unit = com.formdev.flatlaf.FlatLightLaf.setup() |
28 def init_laf(): Unit = flatlaf.FlatLightLaf.setup() |
26 |
29 |
27 def current_laf(): String = UIManager.getLookAndFeel.getClass.getName() |
30 def current_laf(): String = UIManager.getLookAndFeel.getClass.getName() |
28 |
31 |
29 def is_macos_laf(): Boolean = |
32 def is_macos_laf(): Boolean = |
30 Platform.is_macos && UIManager.getSystemLookAndFeelClassName() == current_laf() |
33 Platform.is_macos && UIManager.getSystemLookAndFeelClassName() == current_laf() |
31 |
34 |
32 def is_dark_laf(): Boolean = |
35 def is_dark_laf(): Boolean = FlatLaf.isLafDark() |
33 com.formdev.flatlaf.FlatLaf.isLafDark |
|
34 |
36 |
35 class Look_And_Feel(laf: LookAndFeel) extends Isabelle_System.Service { |
37 class Look_And_Feel(laf: LookAndFeel) extends Isabelle_System.Service { |
36 def info: UIManager.LookAndFeelInfo = |
38 def info: UIManager.LookAndFeelInfo = |
37 new UIManager.LookAndFeelInfo(laf.getName, laf.getClass.getName) |
39 new UIManager.LookAndFeelInfo(laf.getName, laf.getClass.getName) |
38 } |
40 } |