GP-1981 - Theming - PDB and Code Compare Modules

This commit is contained in:
dragonmacher 2022-09-02 16:22:34 -04:00 committed by ghidragon
parent 2f453099ba
commit a99841e6d4
21 changed files with 93 additions and 67 deletions

View file

@ -41,6 +41,8 @@ import docking.widgets.label.GIconLabel;
import docking.widgets.label.GLabel;
import docking.widgets.textfield.HexOrDecimalInput;
import docking.widgets.textfield.HintTextField;
import generic.theme.GThemeDefaults.Colors;
import generic.theme.TempColorUtils;
import ghidra.app.util.bin.format.pdb.PdbParser;
import ghidra.app.util.bin.format.pdb2.pdbreader.PdbIdentifiers;
import ghidra.app.util.pdb.pdbapplicator.PdbApplicatorControl;
@ -172,7 +174,7 @@ public class LoadPdbDialog extends DialogComponentProvider {
protected void dialogShown() {
cancelButton.requestFocusInWindow();
if ( getCurrentSymbolFileInfo() != null ) {
if (getCurrentSymbolFileInfo() != null) {
searchForPdbs(false);
}
}
@ -377,7 +379,7 @@ public class LoadPdbDialog extends DialogComponentProvider {
programNameTextField.setEditable(false);
programNameTextField.setText(program.getName());
pdbPathTextField = new BetterNonEditableTextField(20, "Missing", Color.red);
pdbPathTextField = new BetterNonEditableTextField(20, "Missing", Colors.ERROR);
pdbPathTextField.setEditable(false);
pdbPathTextField.setText(programSymbolFileInfo.getPath());
pdbPathTextField.getDocument().addDocumentListener(docListener);
@ -399,7 +401,7 @@ public class LoadPdbDialog extends DialogComponentProvider {
new HelpLocation(PdbPlugin.PDB_PLUGIN_HELP_TOPIC,
SymbolFilePanel.SEARCH_OPTIONS_HELP_ANCHOR));
pdbUniqueIdTextField = new BetterNonEditableTextField(36, "Missing", Color.red);
pdbUniqueIdTextField = new BetterNonEditableTextField(36, "Missing", Colors.ERROR);
pdbUniqueIdTextField.setEditable(false);
pdbUniqueIdTextField.setText(programSymbolFileInfo.getUniqifierString());
pdbUniqueIdTextField.setToolTipText(
@ -889,10 +891,9 @@ public class LoadPdbDialog extends DialogComponentProvider {
Container parent = getParent();
if (parent != null && !isEditable()) {
Color bg = parent.getBackground();
// mint a new Color object to avoid it being
// ignored because the parent handed us a DerivedColor
// instance
return new Color(bg.getRGB());
// mint a new Color object to avoid it being ignored because the parent handed us a
// DerivedColor instance
return TempColorUtils.fromRgb(bg.getRGB());
}
return super.getBackground();
}
@ -931,10 +932,9 @@ public class LoadPdbDialog extends DialogComponentProvider {
Container parent = getParent();
if (parent != null && !isEditable()) {
Color bg = parent.getBackground();
// mint a new Color object to avoid it being
// ignored because the parent handed us a DerivedColor
// instance
return new Color(bg.getRGB());
// mint a new Color object to avoid it being ignored because the parent handed us a
// DerivedColor instance
return TempColorUtils.fromRgb(bg.getRGB());
}
return super.getBackground();
}

View file

@ -27,6 +27,7 @@ import docking.DockingWindowManager;
import docking.widgets.checkbox.GCheckBox;
import docking.widgets.label.GHtmlLabel;
import docking.widgets.label.GLabel;
import generic.theme.GThemeDefaults.Colors;
import ghidra.util.HelpLocation;
import ghidra.util.table.GhidraTable;
import pdb.PdbPlugin;
@ -40,6 +41,7 @@ class SymbolFilePanel extends JPanel {
interface SearchCallback {
void searchForPdbs(boolean allowRemote);
}
static final String SEARCH_OPTIONS_HELP_ANCHOR = "PDB_Search_Search_Options";
private SymbolFileTableModel tableModel;
private GhidraTable table;
@ -117,7 +119,8 @@ class SymbolFilePanel extends JPanel {
private JPanel buildWelcomePanel() {
welcomePanel = new JPanel();
welcomePanel.add(new GHtmlLabel(
"<html><br><center><font color=red>Configuration must be set first!"));
"<html><br><center><font color=\"" + Colors.ERROR.toHexString() +
"\">Configuration must be set first!"));
welcomePanel.setPreferredSize(tablePanel.getPreferredSize());
return welcomePanel;

View file

@ -36,6 +36,7 @@ import docking.widgets.label.GHtmlLabel;
import docking.widgets.label.GLabel;
import docking.widgets.table.GTable;
import docking.widgets.textfield.HintTextField;
import generic.theme.GThemeDefaults.Colors;
import ghidra.framework.preferences.Preferences;
import ghidra.util.*;
import ghidra.util.layout.PairLayout;
@ -108,7 +109,8 @@ class SymbolServerPanel extends JPanel {
JScrollPane tableScrollPane = buildTable();
defaultConfigNotice = new JPanel();
defaultConfigNotice.add(new GHtmlLabel(
"<html><center><font color=red><br>" + "Missing / invalid configuration.<br><br>" +
"<html><center><font color=\"" + Colors.ERROR.toHexString() +
"\"><br>" + "Missing / invalid configuration.<br><br>" +
"Using default search location:<br>" + "Program's Import Location<br>",
SwingConstants.CENTER));
defaultConfigNotice.setPreferredSize(tableScrollPane.getPreferredSize());
@ -395,8 +397,8 @@ class SymbolServerPanel extends JPanel {
String[] envParts = envString.split("[*;]");
List<String> results = new ArrayList<>();
Set<String> locationStringDeduplicationSet = new HashSet<>();
for (int i = 0; i < envParts.length; i++) {
String locationString = envParts[i].trim();
for (String envPart : envParts) {
String locationString = envPart.trim();
if (!locationString.isBlank() && !locationString.equalsIgnoreCase("srv") &&
!locationStringDeduplicationSet.contains(locationString)) {
results.add(locationString);