MCPcopy Index your code
hub / github.com/benfry/processing4 / updateTheme

Method updateTheme

app/src/processing/app/ui/Editor.java:567–609  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Callers 2

EditorMethod · 0.95
applyPreferencesMethod · 0.95

Calls 5

getSansFontMethod · 0.95
zoomMethod · 0.95
getMethod · 0.95
getColorMethod · 0.95
repaintMethod · 0.80

Tested by

no test coverage detected