mirror of
https://github.com/arduino/Arduino.git
synced 2024-12-01 12:24:14 +01:00
Merge pull request #11200 from magedrifaat/linestatusbug
Fix status bar custom board preferences disappearing
This commit is contained in:
commit
b2265ce4ed
@ -2587,12 +2587,7 @@ public class Editor extends JFrame implements RunnerListener {
|
||||
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
protected void onBoardOrPortChange() {
|
||||
TargetBoard board = BaseNoGui.getTargetBoard();
|
||||
if (board != null)
|
||||
lineStatus.setBoardName(board.getName());
|
||||
else
|
||||
lineStatus.setBoardName("-");
|
||||
lineStatus.setPort(PreferencesData.get("serial.port"));
|
||||
lineStatus.updateBoardAndPort();
|
||||
lineStatus.repaint();
|
||||
}
|
||||
|
||||
|
@ -92,12 +92,7 @@ public class EditorLineStatus extends JComponent {
|
||||
public void paintComponent(Graphics graphics) {
|
||||
Graphics2D g = Theme.setupGraphics2D(graphics);
|
||||
if (name.isEmpty() && port.isEmpty()) {
|
||||
PreferencesMap boardPreferences = BaseNoGui.getBoardPreferences();
|
||||
if (boardPreferences != null)
|
||||
setBoardName(boardPreferences.get("name"));
|
||||
else
|
||||
setBoardName("-");
|
||||
setPort(PreferencesData.get("serial.port"));
|
||||
updateBoardAndPort();
|
||||
}
|
||||
g.setColor(background);
|
||||
Dimension size = getSize();
|
||||
@ -146,4 +141,13 @@ public class EditorLineStatus extends JComponent {
|
||||
public Dimension getMaximumSize() {
|
||||
return scale(new Dimension(3000, height));
|
||||
}
|
||||
|
||||
public void updateBoardAndPort() {
|
||||
PreferencesMap boardPreferences = BaseNoGui.getBoardPreferences();
|
||||
if (boardPreferences != null)
|
||||
setBoardName(boardPreferences.get("name"));
|
||||
else
|
||||
setBoardName("-");
|
||||
setPort(PreferencesData.get("serial.port"));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user