From ce92ca8e8e7a7c98fb6a31e0ea125480f6ac5dfb Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 14:59:23 +0000 Subject: [PATCH] - Another deck editor mod which should help to limit the width to a max of 1400 pixels. Useful for large screen monitors. --- src/forge/Gui_DeckEditor.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/forge/Gui_DeckEditor.java b/src/forge/Gui_DeckEditor.java index 1ef9aa6be74..4b4e67a6914 100644 --- a/src/forge/Gui_DeckEditor.java +++ b/src/forge/Gui_DeckEditor.java @@ -5,6 +5,8 @@ package forge; import java.awt.Color; import java.awt.Component; import java.awt.Container; +import java.awt.Dimension; +import java.awt.Rectangle; // import java.awt.Dimension; import java.awt.Font; import java.awt.Frame; @@ -535,8 +537,22 @@ public class Gui_DeckEditor extends JFrame implements CardContainer, DeckDisplay //TODO use this as soon the deck editor has resizable GUI //Use both so that when "un"maximizing, the frame isn't tiny + setSize(1024, 740); - setExtendedState(Frame.MAXIMIZED_BOTH); + Rectangle bounds = getBounds(); + Dimension screen = getToolkit().getScreenSize(); + int maxWidth; + if (screen.width >= 1400) + maxWidth = 1400; + else + maxWidth = screen.width; + bounds.width = maxWidth; + bounds.height = screen.height; + + setMaximizedBounds(bounds); + + // setSize(1024, 740); + // setExtendedState(Frame.MAXIMIZED_BOTH); }//setupAndDisplay() private String getStats(CardList deck) {