Merge pull request #19 from KronosDesign/swing-updates
Fixed incorrect JFrame size
This commit is contained in:
@@ -37,8 +37,9 @@ import javax.swing.UnsupportedLookAndFeelException;
|
|||||||
|
|
||||||
public final class ClientUI extends JFrame
|
public final class ClientUI extends JFrame
|
||||||
{
|
{
|
||||||
private static final int COLLAPSED_WIDTH = ClientPanel.PANEL_WIDTH + NavigationPanel.PANEL_WIDTH;
|
private static final int PANEL_WIDTH = 805;
|
||||||
private static final int EXPANDED_WIDTH = COLLAPSED_WIDTH + PluginPanel.PANEL_WIDTH;
|
private static final int PANEL_HEIGHT = 541;
|
||||||
|
private static final int EXPANDED_WIDTH = PANEL_WIDTH + PluginPanel.PANEL_WIDTH;
|
||||||
|
|
||||||
private JPanel container;
|
private JPanel container;
|
||||||
private JPanel navContainer;
|
private JPanel navContainer;
|
||||||
@@ -101,15 +102,18 @@ public final class ClientUI extends JFrame
|
|||||||
{
|
{
|
||||||
navContainer.add(pluginPanel, BorderLayout.WEST);
|
navContainer.add(pluginPanel, BorderLayout.WEST);
|
||||||
navContainer.revalidate();
|
navContainer.revalidate();
|
||||||
this.setMinimumSize(new Dimension(EXPANDED_WIDTH, ClientPanel.PANEL_HEIGHT));
|
this.setMinimumSize(new Dimension(EXPANDED_WIDTH, PANEL_HEIGHT));
|
||||||
expanded = true;
|
expanded = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
navContainer.remove(1);
|
navContainer.remove(1);
|
||||||
navContainer.revalidate();
|
navContainer.revalidate();
|
||||||
this.setMinimumSize(new Dimension(COLLAPSED_WIDTH, ClientPanel.PANEL_HEIGHT));
|
this.setMinimumSize(new Dimension(PANEL_WIDTH, PANEL_HEIGHT));
|
||||||
this.setSize(COLLAPSED_WIDTH, this.getHeight());
|
if (this.getWidth() == EXPANDED_WIDTH)
|
||||||
|
{
|
||||||
|
this.setSize(PANEL_WIDTH, PANEL_HEIGHT);
|
||||||
|
}
|
||||||
expanded = false;
|
expanded = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user