Fixed dark theme on KDE
This commit is contained in:
parent
fa236a612f
commit
5a1402bc1d
1 changed files with 14 additions and 4 deletions
|
@ -72,6 +72,7 @@ import org.insa.graphs.model.io.BinaryPathReader;
|
||||||
import org.insa.graphs.model.io.GraphReader;
|
import org.insa.graphs.model.io.GraphReader;
|
||||||
import org.insa.graphs.model.io.MapMismatchException;
|
import org.insa.graphs.model.io.MapMismatchException;
|
||||||
|
|
||||||
|
|
||||||
public class MainWindow extends JFrame {
|
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();
|
JTextArea infoPanel = new JTextArea();
|
||||||
infoPanel.setMinimumSize(new Dimension(200, 50));
|
infoPanel.setMinimumSize(new Dimension(200, 50));
|
||||||
infoPanel.setBackground(Color.WHITE);
|
// infoPanel.setBackground(Color.WHITE);
|
||||||
infoPanel.setLineWrap(true);
|
infoPanel.setLineWrap(true);
|
||||||
infoPanel.setEditable(false);
|
infoPanel.setEditable(false);
|
||||||
this.logStream = new StreamCapturer(infoPanel);
|
this.logStream = new StreamCapturer(infoPanel);
|
||||||
|
@ -377,7 +378,7 @@ public class MainWindow extends JFrame {
|
||||||
mainPanel.setResizeWeight(0.8);
|
mainPanel.setResizeWeight(0.8);
|
||||||
mainPanel.setDividerSize(5);
|
mainPanel.setDividerSize(5);
|
||||||
|
|
||||||
mainPanel.setBackground(Color.WHITE);
|
// mainPanel.setBackground(Color.WHITE);
|
||||||
mainPanel.setLeftComponent(openPanel);
|
mainPanel.setLeftComponent(openPanel);
|
||||||
mainPanel.setRightComponent(rightComponent);
|
mainPanel.setRightComponent(rightComponent);
|
||||||
this.add(mainPanel, BorderLayout.CENTER);
|
this.add(mainPanel, BorderLayout.CENTER);
|
||||||
|
@ -844,7 +845,16 @@ public class MainWindow extends JFrame {
|
||||||
|
|
||||||
// Try to set system look and feel.
|
// Try to set system look and feel.
|
||||||
try {
|
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) {
|
catch (Exception e) {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue