From d4eae5ff3c088f6029cb2b1cdf9f6d0b35f2990b Mon Sep 17 00:00:00 2001
From: dragonmacher <48328597+dragonmacher@users.noreply.github.com>
Date: Tue, 2 May 2023 13:33:19 -0400
Subject: [PATCH] GP-2846 - Theming Documentation
---
.../core/debug/gui/memview/MemoryBox.java | 8 +-
.../core/debug/gui/memview/MemviewPanel.java | 4 +-
.../merge/listing/VariousChoicesPanel.java | 4 +-
.../merge/listing/VerticalChoicesPanel.java | 4 +-
.../StoredAnalyzerTimesPropertyEditor.java | 4 +-
.../app/plugin/core/cparser/ParseDialog.java | 273 +++++++++---------
.../plugin/core/equate/EquateTableModel.java | 4 +-
.../function/editor/FunctionEditorDialog.java | 15 +-
.../editor/StorageTableCellEditor.java | 9 +-
.../function/tags/FunctionTagProvider.java | 8 +-
.../core/hover/AbstractReferenceHover.java | 18 +-
.../instructionsearch/ui/ControlPanel.java | 4 +-
.../interpreter/CodeCompletionWindow.java | 66 ++---
.../LocationReferencesTableModel.java | 7 +-
.../core/overview/entropy/KnotLabelPanel.java | 6 +-
.../core/overview/entropy/PalettePanel.java | 6 +-
.../plugin/core/progmgr/ProgramListPanel.java | 4 +-
.../references/EditMemoryReferencePanel.java | 3 +-
.../references/EditReferencesProvider.java | 57 ++--
.../core/script/GhidraScriptTableModel.java | 4 +-
.../plugin/core/totd/TipOfTheDayDialog.java | 3 +-
.../AbstractScreenShotGenerator.java | 7 +-
.../help/screenshot/ImageDialogProvider.java | 6 +-
.../functiongraph/graph/vertex/FGVertex.java | 51 ++--
.../vertex/ListingGraphComponentPanel.java | 7 +-
.../fid/debug/FidFunctionDebugPanel.java | 17 +-
.../fid/debug/FidSearchDebugDialog.java | 4 +-
.../fid/debug/FidSearchResultFrame.java | 4 +-
.../matchtable/VTMarkupStatusIcon.java | 4 +-
.../vt/gui/wizard/NewSessionPanel.java | 6 +-
.../topics/Theming/ThemingDeveloperDocs.html | 191 +++++++++++-
.../help/topics/Theming/ThemingInternals.html | 3 -
.../help/topics/Theming/ThemingOverview.html | 3 -
.../help/topics/Theming/ThemingUserDocs.html | 14 +-
.../Theming/images/ThemeEditorDialog.png | Bin 48197 -> 63976 bytes
.../src/main/java/docking/EditWindow.java | 29 +-
.../src/main/java/docking/GenericHeader.java | 4 +-
.../SettableColorSwatchChooserPanel.java | 5 +-
.../theme/gui/ThemeColorPaletteTable.java | 2 +
.../docking/theme/gui/ThemeColorTable.java | 15 +-
.../theme/gui/ThemeColorTableModel.java | 32 +-
.../docking/theme/gui/ThemeEditorDialog.java | 17 +-
.../docking/theme/gui/ThemeFontTable.java | 15 +-
.../theme/gui/ThemeFontTableModel.java | 41 ++-
.../docking/theme/gui/ThemeIconTable.java | 15 +-
.../theme/gui/ThemeIconTableModel.java | 38 ++-
.../java/docking/theme/gui/ThemeTable.java | 34 +++
.../docking/theme/gui/ThemeTableContext.java | 13 +-
.../java/docking/util/AnimationUtils.java | 4 +-
.../widgets/AbstractGCellRenderer.java | 9 +
.../DropDownMultiSelectionTextField.java | 23 +-
.../docking/widgets/DropDownTextField.java | 78 ++---
.../widgets/filechooser/DirectoryList.java | 3 +-
.../widgets/filechooser/FileEditor.java | 4 +-
.../widgets/pathmanager/PathManager.java | 10 +-
.../pathmanager/PathnameTablePanel.java | 4 +-
.../constraint/dialog/ColumnFilterDialog.java | 4 +-
.../ghidra/graph/viewer/GraphComponent.java | 2 +-
.../VisualVertexSatelliteRenderer.java | 2 +-
.../viewer/vertex/VisualVertexRenderer.java | 2 +-
.../java/generic/theme/GThemeDefaults.java | 86 ++++--
.../Gui/src/main/java/generic/theme/Gui.java | 12 +-
.../java/generic/theme/SystemThemeIds.java | 17 +-
.../theme/laf/ComponentFontRegistry.java | 2 +-
.../generic/theme/laf/LookAndFeelManager.java | 6 +-
.../theme/laf/NimbusLookAndFeelManager.java | 16 +-
.../generic/theme/laf/UiDefaultsMapper.java | 50 ++--
.../core/help/AboutDomainObjectUtils.java | 4 +-
.../framework/main/EditPluginPathDialog.java | 5 +-
.../dialog/ExtensionTableModel.java | 55 ++--
.../dialog/PluginManagerComponent.java | 3 +-
.../ClipboardPluginScreenShots.java | 4 +-
.../CodeBrowserPluginScreenShots.java | 5 +-
.../java/help/screenshot/ToolScreenShots.java | 3 +-
74 files changed, 903 insertions(+), 598 deletions(-)
create mode 100644 Ghidra/Framework/Docking/src/main/java/docking/theme/gui/ThemeTable.java
diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemoryBox.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemoryBox.java
index b1865930d9..bb29c66e42 100644
--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemoryBox.java
+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemoryBox.java
@@ -20,7 +20,7 @@ import java.awt.Graphics;
import java.util.HashMap;
import java.util.Map;
-import generic.theme.GThemeDefaults.Colors.Java;
+import generic.theme.GThemeDefaults.Colors;
import ghidra.program.model.address.AddressRange;
import ghidra.trace.model.Lifespan;
@@ -137,7 +137,7 @@ public class MemoryBox {
int w = vertical ? getTimePixelWidth() : getAddressPixelWidth();
int y = vertical ? getAddressPixelStart() : getTimePixelStart();
int h = vertical ? getAddressPixelWidth() : getTimePixelWidth();
- g.setColor(Java.BORDER);
+ g.setColor(Colors.BORDER);
g.fillRect(x - 1, y - 1, w + 2, h + 2);
g.setColor(color);
g.fillRect(x, y, w, h);
@@ -148,7 +148,7 @@ public class MemoryBox {
int w = vertical ? sz : getAddressPixelWidth();
int y = vertical ? getAddressPixelStart() : 0;
int h = vertical ? getAddressPixelWidth() : sz;
- g.setColor(Java.BORDER);
+ g.setColor(Colors.BORDER);
g.fillRect(x - 1, y - 1, w + 2, h + 2);
g.setColor(color);
g.fillRect(x, y, w, h);
@@ -159,7 +159,7 @@ public class MemoryBox {
int w = vertical ? 1 : sz;
int y = vertical ? 0 : getTimePixelStart();
int h = vertical ? sz : 1;
- g.setColor(Java.BORDER);
+ g.setColor(Colors.BORDER);
g.fillRect(x - 1, y - 1, w + 2, h + 2);
g.setColor(color);
g.fillRect(x, y, w, h);
diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemviewPanel.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemviewPanel.java
index a141efafe2..341289f903 100644
--- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemviewPanel.java
+++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memview/MemviewPanel.java
@@ -23,7 +23,7 @@ import java.util.List;
import javax.swing.*;
import generic.theme.GColor;
-import generic.theme.GThemeDefaults.Colors.Java;
+import generic.theme.GThemeDefaults.Colors;
import ghidra.program.model.address.Address;
import ghidra.program.model.address.AddressRange;
@@ -64,7 +64,7 @@ public class MemviewPanel extends JPanel implements MouseListener, MouseMotionLi
this.provider = provider;
setPreferredSize(new Dimension(barWidth, barHeight));
setSize(getPreferredSize());
- setBorder(BorderFactory.createLineBorder(Java.BORDER, 1));
+ setBorder(BorderFactory.createLineBorder(Colors.BORDER, 1));
setFocusable(true);
addMouseListener(this);
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/VariousChoicesPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/VariousChoicesPanel.java
index db28e89df4..1349d0c742 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/VariousChoicesPanel.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/VariousChoicesPanel.java
@@ -29,7 +29,7 @@ import docking.widgets.button.GRadioButton;
import docking.widgets.checkbox.GCheckBox;
import docking.widgets.label.GDHtmlLabel;
import docking.widgets.label.GLabel;
-import generic.theme.GThemeDefaults.Colors.Java;
+import generic.theme.GThemeDefaults.Colors;
import ghidra.app.merge.util.ConflictUtility;
import ghidra.util.HTMLUtilities;
import ghidra.util.layout.MaximizeSpecificColumnGridLayout;
@@ -46,7 +46,7 @@ public class VariousChoicesPanel extends ConflictPanel {
private final static long serialVersionUID = 1;
private static final Border UNDERLINE_BORDER =
- BorderFactory.createMatteBorder(0, 0, 1, 0, Java.BORDER);
+ BorderFactory.createMatteBorder(0, 0, 1, 0, Colors.BORDER);
private JPanel rowPanel;
private GDHtmlLabel headerLabel;
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/VerticalChoicesPanel.java b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/VerticalChoicesPanel.java
index b131ab07e7..d37221dc91 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/VerticalChoicesPanel.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/merge/listing/VerticalChoicesPanel.java
@@ -29,7 +29,7 @@ import docking.widgets.button.GRadioButton;
import docking.widgets.checkbox.GCheckBox;
import docking.widgets.label.GDHtmlLabel;
import docking.widgets.label.GDLabel;
-import generic.theme.GThemeDefaults.Colors.Java;
+import generic.theme.GThemeDefaults.Colors;
import ghidra.app.merge.util.ConflictUtility;
import ghidra.util.HTMLUtilities;
import ghidra.util.datastruct.LongArrayList;
@@ -190,7 +190,7 @@ public class VerticalChoicesPanel extends ConflictPanel {
headerComps[i] = new MyLabel(items[i]);
headerComps[i].setName(getComponentName(0, i));
setRowComponent(headerComps[i], 0, i, defaultInsets);
- headerComps[i].setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Java.BORDER));
+ headerComps[i].setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Colors.BORDER));
}
}
rowPanel.validate();
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/StoredAnalyzerTimesPropertyEditor.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/StoredAnalyzerTimesPropertyEditor.java
index 44296a8617..96fb94982e 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/StoredAnalyzerTimesPropertyEditor.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/StoredAnalyzerTimesPropertyEditor.java
@@ -21,7 +21,7 @@ import java.beans.PropertyEditorSupport;
import javax.swing.*;
import docking.widgets.label.GDLabel;
-import generic.theme.GThemeDefaults.Colors.Java;
+import generic.theme.GThemeDefaults.Colors;
import ghidra.framework.options.CustomOptionsEditor;
import ghidra.util.layout.PairLayout;
@@ -116,7 +116,7 @@ public class StoredAnalyzerTimesPropertyEditor extends PropertyEditorSupport
new JTextField(StoredAnalyzerTimes.formatTimeMS(times.getTotalTime()));
valueField.setEditable(false);
valueField.setHorizontalAlignment(SwingConstants.RIGHT);
- valueField.setBorder(BorderFactory.createLineBorder(Java.BORDER, 2));
+ valueField.setBorder(BorderFactory.createLineBorder(Colors.BORDER, 2));
panel.add(valueField);
return panel;
diff --git a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/cparser/ParseDialog.java b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/cparser/ParseDialog.java
index 3b13c69e75..298463fff2 100644
--- a/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/cparser/ParseDialog.java
+++ b/Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/cparser/ParseDialog.java
@@ -26,8 +26,6 @@ import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.TableModel;
-import org.apache.commons.lang3.ObjectUtils;
-
import docking.*;
import docking.action.*;
import docking.widgets.OptionDialog;
@@ -41,11 +39,8 @@ import docking.widgets.pathmanager.PathnameTablePanel;
import docking.widgets.table.GTableCellRenderer;
import docking.widgets.table.GTableCellRenderingData;
import generic.jar.ResourceFile;
-import generic.theme.GThemeDefaults.Colors.Tables;
import ghidra.app.plugin.core.processors.SetLanguageDialog;
-import ghidra.app.util.Option;
import ghidra.app.util.cparser.C.CParserUtils;
-import ghidra.app.util.exporter.Exporter;
import ghidra.framework.Application;
import ghidra.framework.options.SaveState;
import ghidra.framework.preferences.Preferences;
@@ -59,17 +54,17 @@ import ghidra.util.filechooser.ExtensionFileFilter;
import resources.Icons;
/**
- * Dialog that shows files used for parsing C header files. The profile has a list of
- * source header files to parse, followed by parse options (compiler directives).
- * Ghidra supplies a Windows profile by default in core/parserprofiles. The user can do
- * "save as" on this default profile to create new profiles that will be written to the
- * user's We have to set this to true painting, but then false when we are done (Java
+ * components will not paint themselves if the are not showing).
+ *
* @param isShowing true if the component is showing
*/
public void setShowing(boolean isShowing);
diff --git a/Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/graph/vertex/ListingGraphComponentPanel.java b/Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/graph/vertex/ListingGraphComponentPanel.java
index 0bf64aa90b..dd891e06f3 100644
--- a/Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/graph/vertex/ListingGraphComponentPanel.java
+++ b/Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/graph/vertex/ListingGraphComponentPanel.java
@@ -40,6 +40,7 @@ import docking.widgets.label.GDLabel;
import generic.theme.GColor;
import generic.theme.GIcon;
import generic.theme.GThemeDefaults.Colors;
+import generic.theme.GThemeDefaults.Colors.Tooltips;
import ghidra.app.plugin.core.codebrowser.hover.ListingHoverService;
import ghidra.app.plugin.core.functiongraph.FunctionGraphPlugin;
import ghidra.app.plugin.core.functiongraph.graph.FGEdge;
@@ -203,7 +204,7 @@ public class ListingGraphComponentPanel extends AbstractGraphComponentPanel {
boolean useFullSizeTooltip = options.useFullSizeTooltip();
previewListingPanel = new FGVertexListingPanel(controller,
getFormatManager(useFullSizeTooltip), program, addressSet);
- previewListingPanel.setTextBackgroundColor(FGVertex.TOOLTIP_BACKGROUND_COLOR);
+ previewListingPanel.setTextBackgroundColor(Tooltips.BACKGROUND);
previewListingPanel.getFieldPanel().setCursorOn(false);
// keep the tooltip window from getting too big; use an arbitrary, reasonable max
@@ -216,14 +217,14 @@ public class ListingGraphComponentPanel extends AbstractGraphComponentPanel {
tooltipTitleLabel = new GDLabel();
tooltipTitleLabel.setHorizontalAlignment(SwingConstants.LEADING);
- tooltipTitleLabel.setBackground(FGVertex.TOOLTIP_BACKGROUND_COLOR);
+ tooltipTitleLabel.setBackground(Tooltips.BACKGROUND);
tooltipTitleLabel.setOpaque(true);
Font labelFont = tooltipTitleLabel.getFont();
tooltipTitleLabel.setFont(labelFont.deriveFont(Font.BOLD));
JPanel headerPanel = new JPanel(new BorderLayout());
headerPanel.add(tooltipTitleLabel);
- headerPanel.setBorder(BorderFactory.createLineBorder(Colors.Java.BORDER));
+ headerPanel.setBorder(BorderFactory.createLineBorder(Colors.BORDER));
panel.add(headerPanel, BorderLayout.NORTH);
panel.add(previewListingPanel, BorderLayout.CENTER);
diff --git a/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidFunctionDebugPanel.java b/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidFunctionDebugPanel.java
index 68d6a58835..f638525265 100644
--- a/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidFunctionDebugPanel.java
+++ b/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidFunctionDebugPanel.java
@@ -21,7 +21,7 @@ import java.awt.event.ActionListener;
import javax.swing.*;
import docking.widgets.label.GDLabel;
-import generic.theme.GThemeDefaults;
+import generic.theme.GThemeDefaults.Ids.Fonts;
import generic.theme.Gui;
import ghidra.feature.fid.db.*;
import ghidra.feature.fid.service.FidService;
@@ -38,6 +38,7 @@ public class FidFunctionDebugPanel extends JPanel {
/**
* Creates the panel.
* @param service the FID database service
+ * @param fidQueryService the query service
* @param functionRecord the function record to debug
*/
public FidFunctionDebugPanel(FidService service, FidQueryService fidQueryService,
@@ -57,7 +58,7 @@ public class FidFunctionDebugPanel extends JPanel {
JButton button = new JButton(text);
button.addActionListener(listener);
button.setHorizontalAlignment(SwingConstants.LEFT);
- Gui.registerFont(button, GThemeDefaults.Ids.Fonts.MONOSPACED);
+ Gui.registerFont(button, Fonts.MONOSPACED);
add(button);
}
@@ -68,7 +69,7 @@ public class FidFunctionDebugPanel extends JPanel {
private void addLabel(String text) {
JLabel label = new GDLabel(text);
label.setHorizontalAlignment(SwingConstants.LEFT);
- label.setFont(Gui.getFont("font.monospaced"));
+ Gui.registerFont(label, Fonts.MONOSPACED);
add(label);
}
@@ -85,16 +86,14 @@ public class FidFunctionDebugPanel extends JPanel {
libraryRecord.getLibraryVersion(), libraryRecord.getLibraryVariant(),
languageID.getIdAsString()));
- addButton(String.format("0x%016x", functionRecord.getID()),
- e -> FidDebugUtils.searchByFunctionID(functionRecord.getID(), service,
- fidQueryService));
+ addButton(String.format("0x%016x", functionRecord.getID()), e -> FidDebugUtils
+ .searchByFunctionID(functionRecord.getID(), service, fidQueryService));
addButton(functionRecord.getName(),
e -> FidDebugUtils.searchByName(functionRecord.getName(), service, fidQueryService));
- addButton(shorten(functionRecord.getDomainPath()),
- e -> FidDebugUtils.searchByDomainPath(functionRecord.getDomainPath(), service,
- fidQueryService));
+ addButton(shorten(functionRecord.getDomainPath()), e -> FidDebugUtils
+ .searchByDomainPath(functionRecord.getDomainPath(), service, fidQueryService));
addLabel(String.format("Entry Point: 0x%x", functionRecord.getEntryPoint()));
diff --git a/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidSearchDebugDialog.java b/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidSearchDebugDialog.java
index 3ba1bb1279..e0d938b420 100644
--- a/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidSearchDebugDialog.java
+++ b/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidSearchDebugDialog.java
@@ -77,13 +77,13 @@ public class FidSearchDebugDialog extends DialogComponentProvider {
private JLabel getPreparedLabel(String text) {
JLabel label = new GDLabel(text, SwingConstants.RIGHT);
- label.setFont(Gui.getFont(Fonts.MONOSPACED));
+ Gui.registerFont(label, Fonts.MONOSPACED);
return label;
}
private JTextField getPreparedTextField() {
JTextField textField = new JTextField(25);
- textField.setFont(Gui.getFont(Fonts.MONOSPACED));
+ Gui.registerFont(textField, Fonts.MONOSPACED);
return textField;
}
diff --git a/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidSearchResultFrame.java b/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidSearchResultFrame.java
index 1e246cedc7..113fda52dc 100644
--- a/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidSearchResultFrame.java
+++ b/Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/debug/FidSearchResultFrame.java
@@ -26,8 +26,6 @@ import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
import docking.widgets.table.*;
-import generic.theme.GThemeDefaults.Ids.Fonts;
-import generic.theme.Gui;
import ghidra.feature.fid.db.*;
import ghidra.feature.fid.service.FidService;
import ghidra.util.Msg;
@@ -66,7 +64,7 @@ public class FidSearchResultFrame extends JFrame implements FidQueryCloseListene
private void buildFrame() {
GTableCellRenderer renderer = new GTableCellRenderer();
- renderer.setFont(Gui.getFont(Fonts.MONOSPACED));
+ renderer.setFont(renderer.getFixedWidthFont());
int columnCount = table.getColumnCount();
for (int ii = 0; ii < columnCount; ++ii) {
Class> columnClass = table.getColumnClass(ii);
diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/VTMarkupStatusIcon.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/VTMarkupStatusIcon.java
index ec9b80fbdd..e7de5e8cc9 100644
--- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/VTMarkupStatusIcon.java
+++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/provider/matchtable/VTMarkupStatusIcon.java
@@ -22,7 +22,7 @@ import java.util.List;
import javax.swing.Icon;
import generic.theme.GColor;
-import generic.theme.GThemeDefaults.Colors.Java;
+import generic.theme.GThemeDefaults.Colors;
import ghidra.feature.vt.api.main.VTAssociationMarkupStatus;
public class VTMarkupStatusIcon implements Icon {
@@ -74,7 +74,7 @@ public class VTMarkupStatusIcon implements Icon {
drawBar(g, x + startX + BORDER + 1, y + BORDER + 1, width, colors.get(i));
}
- g.setColor(Java.BORDER);
+ g.setColor(Colors.BORDER);
g.drawRect(x, y, WIDTH, HEIGHT);
// g.drawRect(x, y, WIDTH / 2, HEIGHT);
g.drawRect(x + WIDTH, y + HEIGHT / 2 - 3, KNOB_WIDTH, 6);
diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/wizard/NewSessionPanel.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/wizard/NewSessionPanel.java
index 033a24ba16..d4359d9769 100644
--- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/wizard/NewSessionPanel.java
+++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/wizard/NewSessionPanel.java
@@ -27,7 +27,9 @@ import org.apache.commons.lang3.StringUtils;
import docking.widgets.button.BrowseButton;
import docking.widgets.label.GDLabel;
import docking.wizard.*;
-import generic.theme.*;
+import generic.theme.GIcon;
+import generic.theme.GThemeDefaults.Ids.Fonts;
+import generic.theme.Gui;
import ghidra.app.util.task.OpenProgramTask;
import ghidra.app.util.task.OpenProgramTask.OpenProgramRequest;
import ghidra.framework.main.DataTreeDialog;
@@ -74,7 +76,7 @@ public class NewSessionPanel extends AbstractMageJPanel
+ The To promote consistency, theme property files should use the following naming
convention:module.theme.properties file, provide a default value for that ID.
- (Also, you may define an alternate "dark" default value that will be used if the
+ and then in a module.theme.properties file, provide a default value for that
+ ID. (Also, you may define an alternate "dark" default value that will be used if the
current theme is considered a dark theme). The way you
define and use these IDs is a bit different depending on whether the resource is a color, font,
or icon. Colors and icons are similar in that developers use these types by creating either
@@ -182,6 +180,42 @@
+
+ UiDefaultsMapper class . The system.* keys
+ allow users to quickly change many Look and Feel values via these high-level concepts. The
+ laf.* properties are for internal use and do not need to be changed by the user.
+ A description of the system properties can be found in the SystemThemeIds class.
+
+
+
+
+
+
+
+
+
+
+ system property names use the standard property names, such as
+ font, bg and fg. These properties introduce these additional terms:
+ control, view, menu and tooltip. control refers to items that
+ generally control the state of the application, such as buttons and check boxes.
+ view refers to widgets that display data, such as trees, tables and text
+ fields. menu and tooltip work with the items after which they are
+ named.
+ Theme Property Files
@@ -198,7 +232,7 @@
they exist in a module's data directory and are named with the
.theme.properties suffix.Theme Properties File Naming Convention
+ Theme Properties File Naming Convention
+ Properties defined by the theming system do not follow this pattern. To reference a
+ property that does not have a standard prefix, an ID can be prefixed with
+
+
+ This class contains many common application theme values for developers to use, such as
+ the default background color. These values can be used directly so developers do not have
+ to instantiate theme objects using theme IDs.
+
+ When adding icons to the application, consider using standard icons provided by the
+
+ A list of palette colors has been defined in
+ One of the benefits of using the palette system is that it is easy for end-users to change
+ one palette color to update all widgets in the application.
+
+ We recommend you use the existing palette colors when picking colors for your widgets.
+
+ Some developers use HTML messages in labels, tables, tooltips, and in calls to system APIs,
+ like
+ In this example, an HTML message is created and part of that text is colored with the
+ standard error message color, which is red in a light mode theme. You can also use your
+ own
+ The See: This class discusses some of the plumbing the application uses to unify the various Look
+ and Feel concepts presented by the different LaFs.
+ This class is used by the
+ Sometimes switching between themes does not reset all widgets. When
+ this happens, you may notice odd UI artifacts. These will go away when the application is
+ restarted and often when you again switch the theme.
+ Provided by: Theme Manager See the Developer Documentation for more
details on the property ID format and naming conventions.
+ Toggles whether the given table shows system ID values (e.g, those starting with After making changes to one or more theme values, the Theme
diff --git a/Ghidra/Framework/Docking/src/main/help/help/topics/Theming/images/ThemeEditorDialog.png b/Ghidra/Framework/Docking/src/main/help/help/topics/Theming/images/ThemeEditorDialog.png
index e0e17c9667955392d21b64af9e2013884a623f56..5c23d23aaac8d1dccee8b74131b7c4d4936738fe 100644
GIT binary patch
literal 63976
zcmdSAWmp|s(>AzqcL?ql91;i)!JXg|+ya5%?gV#9aCZxy;IMHE?(XjHHqA-S^Stjj
zGyiA$3Z!?_y?d=%tE%p*x+_FMUIGP?01*TNp-4%JDuF=IvLFz|1w1Tpg*LMe2KW!!
zURX*69ymPUje~*Dcn)G34$9V_9Gng8OhA?f4kk?YMs_A9R`zDr4!!Xw(jX8SNJ>;l
z#U=G%(ODa7n-uQk17>W*0d)sNHibD(sn%W@QuX05vt_A!?G&>XTqKYAe)=Sjxt7-T
zRD;AM&z^3bq7%9;Yt_*;93}!)w7)*Q$5Q!pv*Z!}HDAKL-A4Z=1*8wG91lDh#or@U
z0IWq-jJ5Qw5A*MpZ0*i15)j6pLs6>3AK~9~64^xbzvr86|KqaSfA5c}Of8`@Ti@`R
zyQ(?)MGps(jP18& uzBf-G&JGKCk
z`dvZ3fxUUM)cvM}-OI(7<7`Dv53v3J9B2CN{(nzjqrKqLKga*N%mBh0sZFTw5dvQN
zau_>_z+Q?i!eX$rsJZlJg13m!{stg1noQbF+K)5z&TZ8@?&WTbe;yDOrA9qA5dQli
z_RsMD`Q)mBqZ{z|oxObD-e6T8v_Xn83};FQyf;SB4EFvO_^HNnw4;DFwZ9R&-{~I&
z@DdVbW6~YDG77Y?BVQ6u^@K-LR|G+&udp%G>UB?PY1v-vVR&G0!E)%BCwa{OCqRmW
z7*)ctqC$#h5c45>UxZDjj`+GjA* o8`sup!@*FuE4yK0XX^0Z~TBLV3zf2G`6EU0yrP(!v_s*6 qu}5Fh5A43PVqBl@=BT%SEs+ZGWL
z{@UlIKzB=4Nz-Kd(<;r8pP%2}l`Ig WEkUN|t`w6?W9sH>}E[font], or [icon] as appropriate to allow the theme
+ property parser to recognize the values as IDs to other properties. For example, to refer to a
+ system property namedsystem.color.bg.view,
+ you would use the following definition:
+ color.bg.tree = [color]system.color.bg.view
+ Color Values
@@ -319,8 +364,8 @@ color.fg.listing.bytes = orange
Useful Concepts
+
+
+ GThemeDefaults
+
+
+
+
+ Icons
+
+
+
+
+ Icons class. Many generic concepts that require icons are in this class.
+ Palette Colors
+
+
+
+
+
+ gui.palette.theme.properties..
+ These palette colors values are meant to be used by developers to reduce the total number
+ of colors used in the application. These color ids and values are viewable in the
+ Theme Editor Dialog.
+ HTML Foreground Colors in Messages
+
+
+
+
+
+
+ Msg. Using HTML text allows clients to control the formatting of the
+ text, including the usage of color. If you use color in your HTML, then we suggest you do
+ so using GColors, like this:
+
+ String message = "Some text: <FONT COLOR=\"" + Messages.ERROR + "\">" + errorText + "";
+
+
+ GColor object in your HTML messages. Using standard system colors or
+ GColors allows these colors to be updated as the theme changes. We do not
+ recommend the use of hard-coded color values.
+ Options Usage of Colors and Fonts
+
+
+
+
+
+
+
+ Options class in Ghidra facilitates user-configurable options in the
+ application. Previously, developers could use options to allow end-users to control color
+ values. In the new theme-based system, all colors are controlled via theming. However, to
+ make the transition to theming easier for developers, we added methods to the options class
+ that allow the developer to bind color editing via the options UI. These color options will
+ write any changes directly to the theme system.
+ Options.registerThemeColorBinding() and
+ Options.registerThemeFontBinding()
+ UiDefaultsMapper
+
+
+
+
+
+ SystemThemeIds
+
+
+
+
+
+
+ UiDefaultsMapper class and presents a set of resource IDs common across all
+ LaFs. These values can be changed by the user. See also the description of
+ System IDs in this document.
+ Known Issues
+
+
+
+
+
+
+
+
in the top
right corner of the Theme Editor dialog.
+ Toggle Showing System Values
+
+ laf. or system.. By default these values are hidden.
+ Saving Themes
zr=7)!EqK5?B50JTWb3_$yaoq`G{&=w?dg
zcP^c&3BC69-JOn+vGE5TP
!!ke)0lLW|n^1XJ4Yf~IYM}2bIbzJXSXL!FL_k&RKooTYD`wMsg
zeGV>$_Y-+$iF|JE7=hTm(6cOR$h`BF3$`nssV)M3ML?*QcT;!^Z)^Jb$2GYz6ENBo
zbmh6^A3iX*uvk3Inm4i-Ef{mOn8`-EyAvdXlzI)F{}}R#=u$|gvso6``2OhV$dOUV
z&T60Tc>c9kQWC+|Qg9RA?7|yp1h9R|M&uPX%n(=JotJ17O;<|U4l+XCtJzsm(KfcM
zh5?mSd7KhFj0v>{#W8kPgcToLHg$gV%%p!`0VGoP9|P$w=7<7`CKp$9A2u9ct9%^p
zl!QP4c%Zt)$ml&O(kMwE@f>-r@)K}G$TMzgEtpv|`?FI5%g9-NN6P<(5*&}YxVSn7
zTMWTa%l|p1tAUS3L7R#!h!hA10-3|Q-;KY}hkp45s*76#GygzhaV1V
ftM-sLh8X~#Kbn02TPZ8Z
zw-BtD`vFk&w?PW{?EG)v5=(TTVI;f8r3?W8gyM=VVLgpc
A`p4nUVcH$w&ArhHt#Ai05=Gy(V mSyEuYSav<>`H|G9hYx$51_7?S-IDRB~nBt(6c)1MQ19Q)4Kh
z16>E&L3IQ{X$R6AklSP!z2LQ
ze3kZVx3+Nh_VzF^h&|6Vv1Q3+;vxh8i4Q`O<7@nN4^zRTj6nsEPzFwv3mDMc?;}h5
zEX|v0pq<46OKZBoOj0yj^H1!KVdm9Jeo~;cUkZ5UjAc}5e`_i?eLtPcJp{jmq%Fm-
zGT)e9i2?px0h|y16uF2BYHESf4&pRZEq|hV2oPLcBGCH;`nkSU+O>J1tZY_BlaU`q
z9vTsW2~A=l*V=#)8KC5x);KyUCX>H14Ab>3c