()
| 565 | |
| 566 | |
| 567 | public void updateTheme() { |
| 568 | header.updateTheme(); |
| 569 | toolbar.updateTheme(); |
| 570 | textarea.updateTheme(); |
| 571 | errorColumn.updateTheme(); |
| 572 | status.updateTheme(); |
| 573 | console.updateTheme(); |
| 574 | footer.updateTheme(); |
| 575 | |
| 576 | // Not all Modes will have an error table (that's why it's addErrorTable() |
| 577 | // and not createErrorTable() and called by default). |
| 578 | // https://github.com/jdf/processing.py/issues/382#issuecomment-892269678 |
| 579 | if (errorTable != null) { |
| 580 | errorTable.updateTheme(); |
| 581 | } |
| 582 | |
| 583 | toolTipFont = Toolkit.getSansFont(Toolkit.zoom(9), Font.PLAIN); |
| 584 | toolTipTextColor = Theme.get("errors.selection.fgcolor"); |
| 585 | toolTipWarningColor = Theme.get("errors.selection.warning.bgcolor"); |
| 586 | toolTipErrorColor = Theme.get("errors.selection.error.bgcolor"); |
| 587 | |
| 588 | JPopupMenu popup = modePopup.getPopupMenu(); |
| 589 | // Cannot use instanceof because com.formdev.flatlaf.ui.FlatPopupMenuBorder |
| 590 | // is a subclass of EmptyBorder, so just override each time. Cannot set |
| 591 | // null because that will reset the border to the default, not remove it. |
| 592 | // The top/bottom in FlatLaf is 6px, but feels too large. |
| 593 | popup.setBorder(new EmptyBorder(3, 0, 3, 0)); |
| 594 | popup.setBackground(Theme.getColor("mode.popup.enabled.bgcolor")); |
| 595 | |
| 596 | for (Component comp : modePopup.getMenuComponents()) { |
| 597 | if (comp instanceof JMenuItem item) { |
| 598 | if (item.getUI() instanceof PdeMenuItemUI) { |
| 599 | ((PdeMenuItemUI) item.getUI()).updateTheme(); |
| 600 | } else { |
| 601 | item.setUI(new PdeMenuItemUI("mode.popup")); |
| 602 | } |
| 603 | } else if (comp instanceof JPopupMenu.Separator) { |
| 604 | comp.setForeground(Theme.getColor("mode.popup.disabled.fgcolor")); |
| 605 | } |
| 606 | } |
| 607 | |
| 608 | repaint(); // for good measure |
| 609 | } |
| 610 | |
| 611 | |
| 612 | // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
no test coverage detected