diff options
| author | 2021-03-06 16:07:24 +0100 | |
|---|---|---|
| committer | 2021-03-06 16:07:24 +0100 | |
| commit | 5e325ed28d86978841b064b543051626fa1f6132 (patch) | |
| tree | a78b5877c81fb9953efe17b81c1db2027bc8a131 /enigma-swing/src/main/java | |
| parent | Fix right panel width being reset on ui update (diff) | |
| download | enigma-5e325ed28d86978841b064b543051626fa1f6132.tar.gz enigma-5e325ed28d86978841b064b543051626fa1f6132.tar.xz enigma-5e325ed28d86978841b064b543051626fa1f6132.zip | |
easier fix and document UiConfig.getLayout()
Diffstat (limited to 'enigma-swing/src/main/java')
| -rw-r--r-- | enigma-swing/src/main/java/cuchaz/enigma/gui/Gui.java | 4 | ||||
| -rw-r--r-- | enigma-swing/src/main/java/cuchaz/enigma/gui/config/UiConfig.java | 13 |
2 files changed, 14 insertions, 3 deletions
diff --git a/enigma-swing/src/main/java/cuchaz/enigma/gui/Gui.java b/enigma-swing/src/main/java/cuchaz/enigma/gui/Gui.java index 4c29a208..a999cfa5 100644 --- a/enigma-swing/src/main/java/cuchaz/enigma/gui/Gui.java +++ b/enigma-swing/src/main/java/cuchaz/enigma/gui/Gui.java | |||
| @@ -924,9 +924,7 @@ public class Gui implements LanguageChangeListener { | |||
| 924 | logSplit.setLeftComponent(tabs); | 924 | logSplit.setLeftComponent(tabs); |
| 925 | } | 925 | } |
| 926 | 926 | ||
| 927 | if (UiConfig.getLayout().length >= 4) { | 927 | splitRight.setDividerLocation(splitRight.getDividerLocation()); |
| 928 | splitRight.setDividerLocation(UiConfig.getLayout()[2]); | ||
| 929 | } | ||
| 930 | } | 928 | } |
| 931 | 929 | ||
| 932 | @Override | 930 | @Override |
diff --git a/enigma-swing/src/main/java/cuchaz/enigma/gui/config/UiConfig.java b/enigma-swing/src/main/java/cuchaz/enigma/gui/config/UiConfig.java index 8ad6fbbe..828da116 100644 --- a/enigma-swing/src/main/java/cuchaz/enigma/gui/config/UiConfig.java +++ b/enigma-swing/src/main/java/cuchaz/enigma/gui/config/UiConfig.java | |||
| @@ -46,6 +46,19 @@ public final class UiConfig { | |||
| 46 | swing.data().section("General").setDouble("Scale Factor", scale); | 46 | swing.data().section("General").setDouble("Scale Factor", scale); |
| 47 | } | 47 | } |
| 48 | 48 | ||
| 49 | /** | ||
| 50 | * Gets the dimensions of the different panels of the GUI. | ||
| 51 | * <p>These dimensions are used to determine the location of the separators between these panels.</p> | ||
| 52 | * | ||
| 53 | * <ul> | ||
| 54 | * <li>[0] - The height of the obfuscated classes panel</li> | ||
| 55 | * <li>[1] - The width of the classes panel</li> | ||
| 56 | * <li>[2] - The width of the center panel</li> | ||
| 57 | * <li>[3] - The height of the tabs panel. Only used if the logs panel should appear</li> | ||
| 58 | * </ul> | ||
| 59 | * | ||
| 60 | * @return an integer array composed of these 4 dimensions | ||
| 61 | */ | ||
| 49 | public static int[] getLayout() { | 62 | public static int[] getLayout() { |
| 50 | return swing.data().section("Main Window").getIntArray("Layout").orElseGet(() -> new int[] { -1, -1, -1, -1 }); | 63 | return swing.data().section("Main Window").getIntArray("Layout").orElseGet(() -> new int[] { -1, -1, -1, -1 }); |
| 51 | } | 64 | } |