File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -110,11 +110,17 @@ public void paintComponent(Graphics graphics) {
110110 g .drawString (text , scale (6 ), baseline );
111111
112112 g .setColor (messageForeground );
113- String tmp = I18n .format (tr ("{0} on {1}" ), name , serialport );
114-
115- Rectangle2D bounds = g .getFontMetrics ().getStringBounds (tmp , null );
116-
117- g .drawString (tmp , size .width - (int ) bounds .getWidth () - RESIZE_IMAGE_SIZE ,
113+
114+ String statusText ;
115+ if (serialport != null && !serialport .isEmpty ()) {
116+ statusText = I18n .format (tr ("{0} on {1}" ), name , serialport );
117+ } else {
118+ statusText = name ;
119+ }
120+
121+ Rectangle2D bounds = g .getFontMetrics ().getStringBounds (statusText , null );
122+
123+ g .drawString (statusText , size .width - (int ) bounds .getWidth () - RESIZE_IMAGE_SIZE ,
118124 baseline );
119125
120126 if (OSUtils .isMacOS ()) {
You can’t perform that action at this time.
0 commit comments