Fix gapy on macOS and Windows
The problem was that the scaleSelector had a padding around it. Setting the insets to 0 removes that and fixes the y gap issue
This commit is contained in:
parent
d482c62f2e
commit
ac57e0851d
@ -122,7 +122,6 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
|
|||||||
private final ScaleScrollPane scrollPane;
|
private final ScaleScrollPane scrollPane;
|
||||||
|
|
||||||
private final JPanel figureHolder;
|
private final JPanel figureHolder;
|
||||||
private JLabel zoomLabel;
|
|
||||||
|
|
||||||
private JLabel infoMessage;
|
private JLabel infoMessage;
|
||||||
|
|
||||||
@ -266,8 +265,6 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
|
|||||||
revalidate();
|
revalidate();
|
||||||
figureHolder.revalidate();
|
figureHolder.revalidate();
|
||||||
|
|
||||||
zoomLabel.repaint(); // Makes sure the zoom label is above the scaleSelector
|
|
||||||
|
|
||||||
figure3d.repaint();
|
figure3d.repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,14 +301,7 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
|
|||||||
|
|
||||||
setPreferredSize(new Dimension(800, 300));
|
setPreferredSize(new Dimension(800, 300));
|
||||||
|
|
||||||
// MacOS and Windows have a larger y gap than Linux, so this fixes that
|
JPanel ribbon = new JPanel(new MigLayout("insets 0, fill"));
|
||||||
int gap = 0;
|
|
||||||
if (SystemInfo.getPlatform() == SystemInfo.Platform.MAC_OS) {
|
|
||||||
gap = -10;
|
|
||||||
} else if (SystemInfo.getPlatform() == SystemInfo.Platform.WINDOWS) {
|
|
||||||
gap = -5;
|
|
||||||
}
|
|
||||||
JPanel ribbon = new JPanel(new MigLayout(String.format("inset 0, gapy %d, fill", gap)));
|
|
||||||
|
|
||||||
// View Type drop-down
|
// View Type drop-down
|
||||||
ComboBoxModel<VIEW_TYPE> cm = new DefaultComboBoxModel<VIEW_TYPE>(VIEW_TYPE.values()) {
|
ComboBoxModel<VIEW_TYPE> cm = new DefaultComboBoxModel<VIEW_TYPE>(VIEW_TYPE.values()) {
|
||||||
@ -335,9 +325,8 @@ public class RocketPanel extends JPanel implements TreeSelectionListener, Change
|
|||||||
|
|
||||||
// Zoom level selector
|
// Zoom level selector
|
||||||
scaleSelector = new ScaleSelector(scrollPane);
|
scaleSelector = new ScaleSelector(scrollPane);
|
||||||
zoomLabel = new JLabel(trans.get("RocketPanel.lbl.Zoom"));
|
ribbon.add(new JLabel(trans.get("RocketPanel.lbl.Zoom")), "cell 1 0, center");
|
||||||
ribbon.add(zoomLabel, "cell 1 0, center");
|
ribbon.add(scaleSelector, "gapleft para, cell 1 1");
|
||||||
ribbon.add(scaleSelector, "cell 1 1");
|
|
||||||
|
|
||||||
// Show CG/CP
|
// Show CG/CP
|
||||||
JCheckBox showCGCP = new JCheckBox();
|
JCheckBox showCGCP = new JCheckBox();
|
||||||
|
@ -39,7 +39,7 @@ public class ScaleSelector extends JPanel {
|
|||||||
private final JComboBox<String> scaleSelector;
|
private final JComboBox<String> scaleSelector;
|
||||||
|
|
||||||
public ScaleSelector(ScaleScrollPane scroll) {
|
public ScaleSelector(ScaleScrollPane scroll) {
|
||||||
super(new MigLayout());
|
super(new MigLayout("insets 0"));
|
||||||
|
|
||||||
this.scrollPane = scroll;
|
this.scrollPane = scroll;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user