mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-01 23:29:28 +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() {
|
protected void onBoardOrPortChange() {
|
||||||
TargetBoard board = BaseNoGui.getTargetBoard();
|
lineStatus.updateBoardAndPort();
|
||||||
if (board != null)
|
|
||||||
lineStatus.setBoardName(board.getName());
|
|
||||||
else
|
|
||||||
lineStatus.setBoardName("-");
|
|
||||||
lineStatus.setPort(PreferencesData.get("serial.port"));
|
|
||||||
lineStatus.repaint();
|
lineStatus.repaint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,12 +92,7 @@ public class EditorLineStatus extends JComponent {
|
|||||||
public void paintComponent(Graphics graphics) {
|
public void paintComponent(Graphics graphics) {
|
||||||
Graphics2D g = Theme.setupGraphics2D(graphics);
|
Graphics2D g = Theme.setupGraphics2D(graphics);
|
||||||
if (name.isEmpty() && port.isEmpty()) {
|
if (name.isEmpty() && port.isEmpty()) {
|
||||||
PreferencesMap boardPreferences = BaseNoGui.getBoardPreferences();
|
updateBoardAndPort();
|
||||||
if (boardPreferences != null)
|
|
||||||
setBoardName(boardPreferences.get("name"));
|
|
||||||
else
|
|
||||||
setBoardName("-");
|
|
||||||
setPort(PreferencesData.get("serial.port"));
|
|
||||||
}
|
}
|
||||||
g.setColor(background);
|
g.setColor(background);
|
||||||
Dimension size = getSize();
|
Dimension size = getSize();
|
||||||
@ -146,4 +141,13 @@ public class EditorLineStatus extends JComponent {
|
|||||||
public Dimension getMaximumSize() {
|
public Dimension getMaximumSize() {
|
||||||
return scale(new Dimension(3000, height));
|
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…
x
Reference in New Issue
Block a user