Skip to content

Commit

Permalink
gui consistent for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mc-cat-tty committed Jan 26, 2023
1 parent 2fc8b3f commit 1cfe2dd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
1 change: 0 additions & 1 deletion tunable/CommonDimensions.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

public enum CommonDimensions {
WINDOW (1370, 962),
WINDOW_MINIMUM_SIZE (1350, 460),
UPPER_PANEL (1370, 181),
LOWER_PANEL (1370, 91),
PLUS_MINUS_SELECTOR (55, 55),
Expand Down
4 changes: 3 additions & 1 deletion ui/components/clickable/RoundedComboBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ public void setArrowDirection(int arrowDirection) {
setUI(
new BasicComboBoxUI() {
@Override protected JButton createArrowButton() {
return new ArrowButton(SwingConstants.SOUTH);
final var button = new ArrowButton(SwingConstants.SOUTH);
button.setOpaque(false);
return button;
}
}
);
Expand Down
4 changes: 0 additions & 4 deletions ui/components/containers/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ public BasePanel() {
}

@Override public void composeView() {
setPreferredSize(
CommonDimensions.WINDOW.getDimension()
);

setLayout(
new BorderLayout()
);
Expand Down
12 changes: 8 additions & 4 deletions ui/components/containers/Window.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import javax.swing.*;
import javax.swing.table.TableModel;

import java.awt.Dimension;
import java.awt.print.*;

import org.jopendocument.dom.spreadsheet.SpreadSheet;
Expand All @@ -40,6 +41,7 @@ public class Window extends JFrame implements IComponent {
private final SaveFileDialog saveOdsDialog;
private final LoadFileDialog loadFileDialog;
private IRecordFormatter recordFormatter;
private BasePanel basePanel;

public Window(String name) {
super(name);
Expand All @@ -53,7 +55,6 @@ public Window(String name) {
CommonFonts.TEXT_NORMAL.getFont().deriveFont(DEFAULT_FONT_SIZE)
);

setMinimumSize(CommonDimensions.WINDOW_MINIMUM_SIZE.getDimension());
setLocationRelativeTo(null);

saveItem = new MenuItem("Save");
Expand All @@ -62,6 +63,7 @@ public Window(String name) {
csvItem = new MenuItem("CSV");
openDocumentItem = new MenuItem("OpenDocument");
printerItem = new MenuItem("Printer");
basePanel = new BasePanel();

loadFileDialog = new LoadFileDialog(
this,
Expand Down Expand Up @@ -116,9 +118,7 @@ public Window(String name) {
}

@Override public void composeView() {
add(
new BasePanel()
);
add(basePanel);

setJMenuBar(
new MenuBar(
Expand Down Expand Up @@ -154,6 +154,10 @@ public Window(String name) {
);

pack();
setMinimumSize(new Dimension(getWidth(), getHeight()));

basePanel.setPreferredSize(CommonDimensions.WINDOW.getDimension());
pack();
}

@Override public void registerCallbacks() {
Expand Down

0 comments on commit 1cfe2dd

Please sign in to comment.