mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +01:00
Show port on status bar only when selected
This commit is contained in:
parent
cede26883e
commit
fd1b598ea2
@ -110,11 +110,17 @@ public class EditorLineStatus extends JComponent {
|
|||||||
g.drawString(text, scale(6), baseline);
|
g.drawString(text, scale(6), baseline);
|
||||||
|
|
||||||
g.setColor(messageForeground);
|
g.setColor(messageForeground);
|
||||||
String tmp = I18n.format(tr("{0} on {1}"), name, serialport);
|
|
||||||
|
|
||||||
Rectangle2D bounds = g.getFontMetrics().getStringBounds(tmp, null);
|
String statusText;
|
||||||
|
if (serialport != null && !serialport.isEmpty()) {
|
||||||
|
statusText = I18n.format(tr("{0} on {1}"), name, serialport);
|
||||||
|
} else {
|
||||||
|
statusText = name;
|
||||||
|
}
|
||||||
|
|
||||||
g.drawString(tmp, size.width - (int) bounds.getWidth() - RESIZE_IMAGE_SIZE,
|
Rectangle2D bounds = g.getFontMetrics().getStringBounds(statusText, null);
|
||||||
|
|
||||||
|
g.drawString(statusText, size.width - (int) bounds.getWidth() - RESIZE_IMAGE_SIZE,
|
||||||
baseline);
|
baseline);
|
||||||
|
|
||||||
if (OSUtils.isMacOS()) {
|
if (OSUtils.isMacOS()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user