1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-28 09:24:14 +01:00
This commit is contained in:
Ricardo JL Rufino 2024-11-28 04:19:12 +01:00 committed by GitHub
commit b0451f0990
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 7 deletions

View File

@ -244,13 +244,6 @@ public class Base {
Theme.init();
System.setProperty("swing.aatext", PreferencesData.get("editor.antialias", "true"));
// Set the look and feel before opening the window
try {
BaseNoGui.getPlatform().setLookAndFeel();
} catch (Exception e) {
// ignore
}
// Use native popups so they don't look so crappy on osx
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
} else {

View File

@ -57,6 +57,7 @@ import java.util.TreeMap;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import javax.swing.UIManager;
import javax.swing.text.StyleContext;
import org.apache.batik.transcoder.Transcoder;
@ -344,6 +345,28 @@ public class Theme {
// clone the hash table
defaults = new PreferencesMap(table);
// Set the look and feel before opening the window
try {
String laf = defaults.get("ui.laf");
if(laf != null && ! laf.trim().isEmpty()) {
try {
UIManager.setLookAndFeel(laf);
} catch (Exception e) {
e.printStackTrace();
BaseNoGui.getPlatform().setLookAndFeel();
}
}else {
BaseNoGui.getPlatform().setLookAndFeel();
}
} catch (Exception e) {
// ignore
}
}
static private ZippedTheme openZipTheme() {