Color variables in settings file

This commit is contained in:
Iván Delgado 2021-02-02 23:45:10 +01:00
parent 2e3f810f31
commit c8752a6389
2 changed files with 18 additions and 0 deletions

View file

@ -6,4 +6,7 @@
<property key="viewToolBar" value="true"/>
<property key="maxRecentFiles" value="10"/>
<property key="lastPath" value=""/>
<property key="MenuBG" value="#151b1c"/>
<property key="WindowBG" value="#222b2e"/>
<property key="AsideBG" value="#2d383b"/>
</settings>

View file

@ -282,6 +282,9 @@ public class TMUI extends JFrame {
private boolean viewToolBar=true;
private String lastPath = "";
public static Color MenuBG = Color.decode("#151b1c");
public static Color WindowBG = Color.decode("#222b2e");
public static Color AsideBG = Color.decode("#2d383b");
/**
@ -676,6 +679,9 @@ public class TMUI extends JFrame {
sb.append(makePropertyTag("recentFile", recentFile.getAbsolutePath()));
}
sb.append(makePropertyTag("lastPath", lastPath));
sb.append(makePropertyTag("MenuBG", "#"+Integer.toHexString(MenuBG.getRGB()).substring(2)));
sb.append(makePropertyTag("WindowBG", "#"+Integer.toHexString(WindowBG.getRGB()).substring(2)));
sb.append(makePropertyTag("AsideBG", "#"+Integer.toHexString(AsideBG.getRGB()).substring(2)));
sb.append("</settings>\n");
@ -755,6 +761,15 @@ public class TMUI extends JFrame {
}
else if (key.equals("lastPath")) {
lastPath = value;
}
else if (key.equals("MenuBG")) {
MenuBG = Color.decode(value);
}
else if (key.equals("WindowBG")) {
WindowBG = Color.decode(value);
}
else if (key.equals("AsideBG")) {
AsideBG = Color.decode(value);
}
}
}