mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-07-17 20:38:08 +00:00
window state icon localization fixed (minimize, maximize, etc..), caching font policy
This commit is contained in:
@@ -42,6 +42,7 @@ import java.awt.event.ActionListener;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.Socket;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
@@ -665,7 +666,16 @@ public class Main {
|
||||
Locale.setDefault(Locale.forLanguageTag(Configuration.locale.get()));
|
||||
AppStrings.updateLanguage();
|
||||
ErrorLogFrame.createNewInstance();
|
||||
|
||||
|
||||
try {
|
||||
Class<?> cl = Class.forName("org.pushingpixels.substance.api.SubstanceLookAndFeel");
|
||||
Field field = cl.getDeclaredField("LABEL_BUNDLE");
|
||||
field.setAccessible(true);
|
||||
field.set(null, null);
|
||||
} catch (Throwable ex) {
|
||||
Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
||||
UIManager.put("OptionPane.okButtonText", AppStrings.translate("button.ok"));
|
||||
UIManager.put("OptionPane.yesButtonText", AppStrings.translate("button.yes"));
|
||||
UIManager.put("OptionPane.noButtonText", AppStrings.translate("button.no"));
|
||||
|
||||
@@ -127,10 +127,16 @@ public class SelectLanguageDialog extends AppDialog implements ActionListener {
|
||||
}
|
||||
|
||||
public static void reloadUi() {
|
||||
Locale.setDefault(Locale.forLanguageTag(Configuration.locale.get()));
|
||||
DefaultSyntaxKit.reloadConfigs();
|
||||
Main.initLang();
|
||||
Main.reloadApp();
|
||||
View.execInEventDispatchLater(new Runnable() {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Locale.setDefault(Locale.forLanguageTag(Configuration.locale.get()));
|
||||
DefaultSyntaxKit.reloadConfigs();
|
||||
Main.initLang();
|
||||
Main.reloadApp();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static String[] getAvailableLanguages() {
|
||||
|
||||
@@ -93,45 +93,74 @@ public class View {
|
||||
|
||||
//Restore default font for chinese characters
|
||||
SubstanceLookAndFeel.setFontPolicy(new FontPolicy() {
|
||||
|
||||
private final FontSet fontSet = new FontSet() {
|
||||
|
||||
private FontUIResource controlFont;
|
||||
private FontUIResource menuFont;
|
||||
private FontUIResource titleFont;
|
||||
private FontUIResource windowTitleFont;
|
||||
private FontUIResource smallFont;
|
||||
private FontUIResource messageFont;
|
||||
|
||||
@Override
|
||||
public FontUIResource getControlFont() {
|
||||
if (controlFont == null) {
|
||||
FontUIResource f = fs.getControlFont();
|
||||
controlFont = new FontUIResource(defaultFont.getName(), f.getStyle(), f.getSize());
|
||||
}
|
||||
return controlFont;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FontUIResource getMenuFont() {
|
||||
if (menuFont == null) {
|
||||
FontUIResource f = fs.getMenuFont();
|
||||
menuFont = new FontUIResource(defaultFont.getName(), f.getStyle(), f.getSize());
|
||||
}
|
||||
return menuFont;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FontUIResource getTitleFont() {
|
||||
if (titleFont == null) {
|
||||
FontUIResource f = fs.getTitleFont();
|
||||
titleFont = new FontUIResource(defaultFont.getName(), f.getStyle(), f.getSize());
|
||||
}
|
||||
return titleFont;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FontUIResource getWindowTitleFont() {
|
||||
if (windowTitleFont == null) {
|
||||
FontUIResource f = fs.getWindowTitleFont();
|
||||
windowTitleFont = new FontUIResource(defaultFont.getName(), f.getStyle(), f.getSize());
|
||||
}
|
||||
return windowTitleFont;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FontUIResource getSmallFont() {
|
||||
if (smallFont == null) {
|
||||
FontUIResource f = fs.getSmallFont();
|
||||
smallFont = new FontUIResource(defaultFont.getName(), f.getStyle(), f.getSize());
|
||||
}
|
||||
return smallFont;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FontUIResource getMessageFont() {
|
||||
if (messageFont == null) {
|
||||
FontUIResource f = fs.getMessageFont();
|
||||
messageFont = new FontUIResource(defaultFont.getName(), f.getStyle(), f.getSize());
|
||||
}
|
||||
return messageFont;
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public FontSet getFontSet(String string, UIDefaults uid) {
|
||||
return new FontSet() {
|
||||
@Override
|
||||
public FontUIResource getControlFont() {
|
||||
FontUIResource f = fs.getControlFont();
|
||||
return new FontUIResource(defaultFont.getName(), f.getStyle(), f.getSize());
|
||||
}
|
||||
|
||||
@Override
|
||||
public FontUIResource getMenuFont() {
|
||||
FontUIResource f = fs.getMenuFont();
|
||||
return new FontUIResource(defaultFont.getName(), f.getStyle(), f.getSize());
|
||||
}
|
||||
|
||||
@Override
|
||||
public FontUIResource getTitleFont() {
|
||||
FontUIResource f = fs.getTitleFont();
|
||||
return new FontUIResource(defaultFont.getName(), f.getStyle(), f.getSize());
|
||||
}
|
||||
|
||||
@Override
|
||||
public FontUIResource getWindowTitleFont() {
|
||||
FontUIResource f = fs.getWindowTitleFont();
|
||||
return new FontUIResource(defaultFont.getName(), f.getStyle(), f.getSize());
|
||||
}
|
||||
|
||||
@Override
|
||||
public FontUIResource getSmallFont() {
|
||||
FontUIResource f = fs.getSmallFont();
|
||||
return new FontUIResource(defaultFont.getName(), f.getStyle(), f.getSize());
|
||||
}
|
||||
|
||||
@Override
|
||||
public FontUIResource getMessageFont() {
|
||||
FontUIResource f = fs.getMessageFont();
|
||||
return new FontUIResource(defaultFont.getName(), f.getStyle(), f.getSize());
|
||||
}
|
||||
};
|
||||
return fontSet;
|
||||
}
|
||||
});
|
||||
} catch (UnsupportedLookAndFeelException ex) {
|
||||
|
||||
Reference in New Issue
Block a user