Fixed dark theme on KDE

This commit is contained in:
Arnaud Vergnet 2020-03-22 19:41:56 +01:00
parent fa236a612f
commit 5a1402bc1d

View file

@ -72,6 +72,7 @@ import org.insa.graphs.model.io.BinaryPathReader;
import org.insa.graphs.model.io.GraphReader;
import org.insa.graphs.model.io.MapMismatchException;
public class MainWindow extends JFrame {
/**
@ -82,7 +83,7 @@ public class MainWindow extends JFrame {
/**
*
*/
private static final String WINDOW_TITLE = "BE Graphes INSA";
private static final String WINDOW_TITLE = "CC la famille";
/**
*
@ -344,7 +345,7 @@ public class MainWindow extends JFrame {
JTextArea infoPanel = new JTextArea();
infoPanel.setMinimumSize(new Dimension(200, 50));
infoPanel.setBackground(Color.WHITE);
// infoPanel.setBackground(Color.WHITE);
infoPanel.setLineWrap(true);
infoPanel.setEditable(false);
this.logStream = new StreamCapturer(infoPanel);
@ -377,7 +378,7 @@ public class MainWindow extends JFrame {
mainPanel.setResizeWeight(0.8);
mainPanel.setDividerSize(5);
mainPanel.setBackground(Color.WHITE);
// mainPanel.setBackground(Color.WHITE);
mainPanel.setLeftComponent(openPanel);
mainPanel.setRightComponent(rightComponent);
this.add(mainPanel, BorderLayout.CENTER);
@ -844,7 +845,16 @@ public class MainWindow extends JFrame {
// Try to set system look and feel.
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
boolean isThemeSet = false;
for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
if ("com.sun.java.swing.plaf.gtk.GTKLookAndFeel".equals(info.getClassName())) {
UIManager.setLookAndFeel(info.getClassName());
isThemeSet = true;
break;
}
}
if (!isThemeSet)
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch (Exception e) {
}