diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/DisassembledViewPlugin.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/DisassembledViewPlugin.java index 6a6a0e9885..bef8190a3e 100644 --- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/DisassembledViewPlugin.java +++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/disassembler/DisassembledViewPlugin.java @@ -392,6 +392,10 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec // we need to do some custom rendering contentList.setCellRenderer(new GListCellRenderer() { + { + setBaseFontId(FieldFactory.BASE_LISTING_FONT_ID); + } + @Override protected String getItemText(DisassembledAddressInfo value) { return value.getAddressPreview(addressPreviewFormat); @@ -406,8 +410,6 @@ public class DisassembledViewPlugin extends ProgramPlugin implements DomainObjec super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); - setFont(Gui.getFont(FieldFactory.BASE_LISTING_FONT_ID)); - setToolTipText(TOOLTIP_TEXT_PREPEND + HTMLUtilities.escapeHTML(currentLocation.getAddress().toString())); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/widgets/AbstractGCellRenderer.java b/Ghidra/Framework/Docking/src/main/java/docking/widgets/AbstractGCellRenderer.java index 8c7c5cff7e..0ad729d83b 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/widgets/AbstractGCellRenderer.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/widgets/AbstractGCellRenderer.java @@ -32,6 +32,7 @@ import generic.theme.GThemeDefaults.Colors.Palette; import generic.theme.GThemeDefaults.Colors.Tables; import generic.theme.laf.FontChangeListener; import ghidra.util.Msg; +import ghidra.util.SystemUtilities; import util.CollectionUtils; import utilities.util.reflection.ReflectionUtilities; @@ -76,6 +77,7 @@ public abstract class AbstractGCellRenderer extends GDHtmlLabel implements FontC protected Font fixedWidthFont; protected Font boldFont; protected Font italicFont; + private boolean showedFontWarning; protected int dropRow = -1; private boolean instanceAlternateRowColors = true; @@ -216,6 +218,15 @@ public abstract class AbstractGCellRenderer extends GDHtmlLabel implements FontC } protected void checkForInvalidSetFont(Font f) { + + if (!SystemUtilities.isInDevelopmentMode()) { + return; + } + + if (showedFontWarning) { + return; + } + // // Due to the nature of how setFont() is typically used (external client setup vs internal // rendering), we created setBaseFontId() to allow external clients to set the base font in @@ -231,6 +242,7 @@ public abstract class AbstractGCellRenderer extends GDHtmlLabel implements FontC return; // the UI will set fonts while the theme is updating } + showedFontWarning = true; String caller = ReflectionUtilities .getClassNameOlderThan(AbstractGCellRenderer.class.getName(), "generic.theme"); Msg.debug(this, "Calling setFont() on the renderer is discouraged. " +