Solution to 0000659: Left panel on main launcher screen is n
Hi,
Here is a possible solution (unified diff) to issue "0000659: Left panel on main launcher screen is not scrollable when items expand past bottom of window" in the bug tracker (sorry, it will not let me post the actual link
).
Basically, I have made a few minor alterations which prevent two menu groups from being open at the same time which makes the overall display more compact. For example, if the Sanctioned Formats section is open and you click on Game Settings, the Sanctioned section will automatically collapse.
I have also moved the Exit Form and Deck Editor buttons to the top of the menu options (underneath the logo) so that they are not constantly moving up and down as menu selections are made.
Steve.
Here is a possible solution (unified diff) to issue "0000659: Left panel on main launcher screen is not scrollable when items expand past bottom of window" in the bug tracker (sorry, it will not let me post the actual link
Basically, I have made a few minor alterations which prevent two menu groups from being open at the same time which makes the overall display more compact. For example, if the Sanctioned Formats section is open and you click on Game Settings, the Sanctioned section will automatically collapse.
I have also moved the Exit Form and Deck Editor buttons to the top of the menu options (underneath the logo) so that they are not constantly moving up and down as menu selections are made.
- Code: Select all
e8e9215ab75040689daf64cfd3c7613d805581ea
trunk/src/main/java/forge/gui/home/LblGroup.java | 24 ++++++++++++----------
trunk/src/main/java/forge/gui/home/VHomeUI.java | 11 ++++++----
.../java/forge/properties/ForgePreferences.java | 2 +-
3 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/trunk/src/main/java/forge/gui/home/LblGroup.java b/trunk/src/main/java/forge/gui/home/LblGroup.java
index cc47180..5b40bdc 100644
--- a/trunk/src/main/java/forge/gui/home/LblGroup.java
+++ b/trunk/src/main/java/forge/gui/home/LblGroup.java
@@ -22,8 +22,10 @@ import forge.properties.ForgePreferences.FPref;
*/
@SuppressWarnings("serial")
public class LblGroup extends JLabel implements ILocalRepaint {
+
+ private static EMenuGroup activeMenuGroup = null;
+
private boolean hovered = false;
- private boolean collapsed = true;
private final Color clrTheme = FSkin.getColor(FSkin.Colors.CLR_THEME);
private final Color l20 = FSkin.stepColor(clrTheme, 20);
@@ -39,7 +41,7 @@ public class LblGroup extends JLabel implements ILocalRepaint {
* @param e0 {@link forge.gui.home.EMenuGroup}
*/
public LblGroup(final EMenuGroup e0) {
- super(" + " + e0.getTitle());
+ super(" " + e0.getTitle());
this.setFont(FSkin.getBoldFont(14));
this.setForeground(FSkin.getColor(FSkin.Colors.CLR_TEXT));
@@ -68,6 +70,15 @@ public class LblGroup extends JLabel implements ILocalRepaint {
* @param e0 {@link forge.gui.home.EMenuGroup}
*/
public void groupClick(final EMenuGroup e0) {
+ if (e0 != activeMenuGroup) {
+ if (activeMenuGroup != null) {
+ toggleCollapseState(activeMenuGroup);
+ }
+ toggleCollapseState(e0);
+ activeMenuGroup = e0;
+ }
+ }
+ private void toggleCollapseState(final EMenuGroup e0) {
final Component[] menuObjects = this.getParent().getComponents();
// Toggle label items in this group
@@ -88,15 +99,6 @@ public class LblGroup extends JLabel implements ILocalRepaint {
break;
}
}
-
- if (this.collapsed) {
- this.collapsed = false;
- this.setText(" - " + e0.getTitle());
- }
- else {
- this.collapsed = true;
- this.setText(" + " + e0.getTitle());
- }
}
@Override
diff --git a/trunk/src/main/java/forge/gui/home/VHomeUI.java b/trunk/src/main/java/forge/gui/home/VHomeUI.java
index 32c78f0..c4a2597 100644
--- a/trunk/src/main/java/forge/gui/home/VHomeUI.java
+++ b/trunk/src/main/java/forge/gui/home/VHomeUI.java
@@ -98,6 +98,8 @@ public enum VHomeUI implements IVTopLevelUI {
private VHomeUI() {
pnlMenu.add(lblLogo, "w 150px!, h 150px!, gap 0 0 5px 10px, ax center");
+ layoutMainMenuButtons();
+
// Add new menu items here (order doesn't matter).
allSubmenus.add(VSubmenuConstructed.SINGLETON_INSTANCE);
allSubmenus.add(VSubmenuDraft.SINGLETON_INSTANCE);
@@ -152,7 +154,10 @@ public enum VHomeUI implements IVTopLevelUI {
allGroupLabels.get(e).groupClick(e);
}
}
-
+ pnlDisplay.setBackground(FSkin.alphaColor(l00, 100));
+ }
+
+ private void layoutMainMenuButtons() {
JPanel pnlButtons = new JPanel(new MigLayout("insets 0, gap 0, wrap 3"));
pnlButtons.setOpaque(false);
@@ -163,10 +168,8 @@ public enum VHomeUI implements IVTopLevelUI {
pnlButtons.add(lblStartServer, "w 170px!, h 25px!, gap 0 10px 10px 0, sx 2 ");
pnlButtons.add(lblStopServer, "w 50px!, h 25px!, gap 0 0 10px 0");
lblStopServer.setEnabled(false);
- }
-
+ }
pnlMenu.add(pnlButtons, "w 230px!, gap 10px 0 10px 10px");
- pnlDisplay.setBackground(FSkin.alphaColor(l00, 100));
}
/** @return {@link forge.gui.toolbox.ExperimentalLabel} */
diff --git a/trunk/src/main/java/forge/properties/ForgePreferences.java b/trunk/src/main/java/forge/properties/ForgePreferences.java
index f97360b..3d8b682 100644
--- a/trunk/src/main/java/forge/properties/ForgePreferences.java
+++ b/trunk/src/main/java/forge/properties/ForgePreferences.java
@@ -59,7 +59,7 @@ public class ForgePreferences extends PreferencesStore<ForgePreferences.FPref> {
UI_FOR_TOUCHSCREN("false"),
SUBMENU_CURRENTMENU (EMenuItem.CONSTRUCTED.toString()),
- SUBMENU_SANCTIONED ("false"),
+ SUBMENU_SANCTIONED ("true"),
SUBMENU_GAUNTLET ("false"),
SUBMENU_VARIANT ("false"),
SUBMENU_QUEST ("false"),
Steve.
) and made it a bit easier to read. There does seem to be quite a lot of white text on slightly less white background.