Skip to content

Commit

Permalink
Enhance readability
Browse files Browse the repository at this point in the history
  • Loading branch information
RetGal committed Nov 11, 2023
1 parent 836c897 commit a718202
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/main/java/mpo/dayon/common/gui/common/BaseFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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() : ""));
}
}

Expand Down Expand Up @@ -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() {

Expand Down

0 comments on commit a718202

Please sign in to comment.