From a718202b23116df9454bf66f394b08dc7622454f Mon Sep 17 00:00:00 2001 From: retgal Date: Sat, 11 Nov 2023 21:15:35 +0100 Subject: [PATCH] Enhance readability --- .../dayon/common/gui/common/BaseFrame.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/main/java/mpo/dayon/common/gui/common/BaseFrame.java b/src/main/java/mpo/dayon/common/gui/common/BaseFrame.java index 907d43f9..1fbe3fb2 100644 --- a/src/main/java/mpo/dayon/common/gui/common/BaseFrame.java +++ b/src/main/java/mpo/dayon/common/gui/common/BaseFrame.java @@ -22,6 +22,14 @@ public abstract class BaseFrame extends JFrame { + private static final String HTTP_HOME = "https://github.com/retgal/dayon"; + + private static final String HTTP_SUPPORT = "https://retgal.github.io/Dayon/" + translate("support.html"); + + private static final String HTTP_FEEDBACK = HTTP_HOME + "/issues"; + + protected static final Object[] OK_CANCEL_OPTIONS = {translate("cancel"), translate("ok")}; + private transient FrameConfiguration configuration; private transient Position position; @@ -32,11 +40,9 @@ public abstract class BaseFrame extends JFrame { private ToolBar toolBar; - protected static final Object[] OK_CANCEL_OPTIONS = {translate("cancel"), translate("ok")}; - private StatusBar statusBar; - private Locale locale; + private Locale currentLocale; protected BaseFrame() { setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); @@ -72,10 +78,10 @@ protected void setFrameType(FrameType frameType) { } private void setTitle() { - Locale currentLocale = InputContext.getInstance().getLocale(); - if (currentLocale != locale) { - locale = currentLocale; - setTitle(format("Dayon! (%s) %s %s", translate(frameType.getPrefix()), Version.get(), locale != null ? locale.toString() : "")); + Locale newLocale = InputContext.getInstance().getLocale(); + if (newLocale != currentLocale) { + currentLocale = newLocale; + setTitle(format("Dayon! (%s) %s %s", translate(frameType.getPrefix()), Version.get(), currentLocale != null ? currentLocale.toString() : "")); } } @@ -106,10 +112,6 @@ public void actionPerformed(ActionEvent ev) { return exit; } - private static final String HTTP_HOME = "https://github.com/retgal/dayon"; - private static final String HTTP_SUPPORT = "https://retgal.github.io/Dayon/" + translate("support.html"); - private static final String HTTP_FEEDBACK = HTTP_HOME + "/issues"; - private Action createShowInfoAction() { final Action showSystemInfo = new AbstractAction() {