Skip to content

Commit

Permalink
Some Fixes to Recently Discussed UX Bugs (#563)
Browse files Browse the repository at this point in the history
* frame and panels default sizes, default pos on screen

* hardcoded version number

* homepanel default size

* set panels' own sizes

* some changes

* Removed unused import

---------

Co-authored-by: Charles Tian <[email protected]>
Co-authored-by: Corppet <[email protected]>
  • Loading branch information
3 people authored Oct 3, 2023
1 parent 7ff8873 commit 145e316
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/java/edu/rpi/legup/ui/HomePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ private void initText() {
credits.setFont(new Font("Roboto", Font.PLAIN, 12));
credits.setAlignmentX(Component.CENTER_ALIGNMENT);

JLabel version = new JLabel("Version 3.0.0"); // This should be autochanged in the future
JLabel version = new JLabel("Version 5.1.0"); // This should be autochanged in the future
version.setFont(new Font("Roboto", Font.ITALIC, 10));
version.setAlignmentX(Component.CENTER_ALIGNMENT);

Expand Down
7 changes: 3 additions & 4 deletions src/main/java/edu/rpi/legup/ui/LegupUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ public LegupUI() {
setExtendedState(getExtendedState() | JFrame.MAXIMIZED_BOTH);
}

setVisible(true);

this.addWindowListener(this);
addKeyListener(new KeyAdapter() {
/**
Expand All @@ -88,8 +86,8 @@ public void keyTyped(KeyEvent e) {
super.keyTyped(e);
}
});
setLocationRelativeTo(null);
setMinimumSize(getPreferredSize());
setVisible(true);
}

private void initPanels() {
Expand All @@ -112,6 +110,7 @@ protected void displayPanel(int option) {
panels[option].makeVisible();
this.window.add(panels[option]);
pack();
setLocationRelativeTo(null);
revalidate();
repaint();
}
Expand Down Expand Up @@ -208,4 +207,4 @@ public DynamicView getEditorDynamicBoardView() {
public TreePanel getTreePanel() {
return getProofEditor().getTreePanel();
}
}
}
3 changes: 2 additions & 1 deletion src/main/java/edu/rpi/legup/ui/ProofEditorPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ public ProofEditorPanel(FileDialog fileDialog, JFrame frame, LegupUI legupUI) {
this.frame = frame;
this.legupUI = legupUI;
setLayout(new BorderLayout());
setPreferredSize(new Dimension(800, 700));
}

@Override
Expand Down Expand Up @@ -343,7 +344,7 @@ public void actionPerformed(ActionEvent e) {

about.add(aboutLegup);
aboutLegup.addActionListener(l -> {
JOptionPane.showMessageDialog(null, "Version: 2.0.0");
JOptionPane.showMessageDialog(null, "Version: 5.1.0");
});

about.add(helpLegup);
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/edu/rpi/legup/ui/PuzzleEditorPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public PuzzleEditorPanel(FileDialog fileDialog, JFrame frame, LegupUI legupUI) {
this.frame = frame;
this.legupUI = legupUI;
setLayout(new BorderLayout());
setPreferredSize(new Dimension(800, 700));
}

protected void setupContent() {
Expand Down Expand Up @@ -202,7 +203,7 @@ public void actionPerformed(ActionEvent e) {
});
menus[2].add(aboutLegup);
aboutLegup.addActionListener(l -> {
JOptionPane.showMessageDialog(null, "Version: 2.0.0");
JOptionPane.showMessageDialog(null, "Version: 5.1.0");
});
// add menus to menubar
for (JMenu menu : menus) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected boolean shouldRotateTabRuns(int i) {

setLayout(new BorderLayout());
setMinimumSize(new Dimension(250, 256));
setPreferredSize(new Dimension(330, 256));
setPreferredSize(new Dimension(355, 256));

add(tabbedPane);
add(status, BorderLayout.SOUTH);
Expand Down

0 comments on commit 145e316

Please sign in to comment.