1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-11-28 09:24:14 +01:00

Merge pull request #11650 from cmaglie/fix_font_resize_hide_tabs

Fix: Font size change corrupts inactive tabs
This commit is contained in:
Cristian Maglie 2021-08-23 12:09:38 +02:00 committed by GitHub
commit 23a023219b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1452,8 +1452,10 @@ public class Editor extends JFrame implements RunnerListener {
// This must be run in the GUI thread
SwingUtilities.invokeLater(() -> {
codePanel.removeAll();
codePanel.add(tabs.get(index), BorderLayout.CENTER);
tabs.get(index).requestFocusInWindow(); // get the caret blinking
EditorTab selectedTab = tabs.get(index);
codePanel.add(selectedTab, BorderLayout.CENTER);
selectedTab.applyPreferences();
selectedTab.requestFocusInWindow(); // get the caret blinking
// For some reason, these are needed. Revalidate says it should be
// automatically called when components are added or removed, but without
// it, the component switched to is not displayed. repaint() is needed to