Skip to content

Commit 03f27cd

Browse files
author
Federico Fissore
committed
SerialMonitor: set minimum sizes to avoid components disappearing
1 parent 9dd4e76 commit 03f27cd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

app/src/processing/app/AbstractMonitor.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ public void actionPerformed(ActionEvent event) {
9090
autoscrollBox = new JCheckBox(_("Autoscroll"), true);
9191

9292
noLineEndingAlert = new JLabel(I18n.format(_("You've pressed {0} but nothing was sent. Should you select a line ending?"), _("Send")));
93+
noLineEndingAlert.setToolTipText(noLineEndingAlert.getText());
9394
noLineEndingAlert.setForeground(pane.getBackground());
95+
Dimension minimumSize = new Dimension(noLineEndingAlert.getMinimumSize());
96+
minimumSize.setSize(minimumSize.getWidth() / 3, minimumSize.getHeight());
97+
noLineEndingAlert.setMinimumSize(minimumSize);
9498

9599
lineEndings = new JComboBox(new String[]{_("No line ending"), _("Newline"), _("Carriage return"), _("Both NL & CR")});
96100
lineEndings.addActionListener(new ActionListener() {
@@ -124,6 +128,8 @@ public void actionPerformed(ActionEvent event) {
124128
pane.add(Box.createRigidArea(new Dimension(8, 0)));
125129
pane.add(serialRates);
126130

131+
this.setMinimumSize(new Dimension(pane.getMinimumSize().width, this.getPreferredSize().height));
132+
127133
getContentPane().add(pane, BorderLayout.SOUTH);
128134

129135
pack();

0 commit comments

Comments
 (0)