summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar 2xsaiko2021-03-07 14:44:52 +0100
committerGravatar GitHub2021-03-07 14:44:52 +0100
commit148f5b3df7d8a49c3f316b97d8df811509beeb1b (patch)
treea78b5877c81fb9953efe17b81c1db2027bc8a131
parentBump version (diff)
parenteasier fix and document UiConfig.getLayout() (diff)
downloadenigma-148f5b3df7d8a49c3f316b97d8df811509beeb1b.tar.gz
enigma-148f5b3df7d8a49c3f316b97d8df811509beeb1b.tar.xz
enigma-148f5b3df7d8a49c3f316b97d8df811509beeb1b.zip
Merge pull request #354 from YanisBft/fix-split-right
Fix right panel width being reset on ui update
-rw-r--r--enigma-swing/src/main/java/cuchaz/enigma/gui/Gui.java2
-rw-r--r--enigma-swing/src/main/java/cuchaz/enigma/gui/config/UiConfig.java13
2 files changed, 15 insertions, 0 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 17e1cbcf..a999cfa5 100644
--- a/enigma-swing/src/main/java/cuchaz/enigma/gui/Gui.java
+++ b/enigma-swing/src/main/java/cuchaz/enigma/gui/Gui.java
@@ -923,6 +923,8 @@ public class Gui implements LanguageChangeListener {
923 splitRight.setRightComponent(logSplit); 923 splitRight.setRightComponent(logSplit);
924 logSplit.setLeftComponent(tabs); 924 logSplit.setLeftComponent(tabs);
925 } 925 }
926
927 splitRight.setDividerLocation(splitRight.getDividerLocation());
926 } 928 }
927 929
928 @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 }