GP-3346 - Theme color fixes for debugger in dark mode; added padding to

Decompiler line numbers
This commit is contained in:
dragonmacher 2023-04-21 16:29:23 -04:00
parent cd4452ace9
commit 39966e99ab
6 changed files with 33 additions and 27 deletions

View File

@ -33,14 +33,15 @@ color.fg.debugger.plugin.objects.accessor = color.palette.lightgray
color.fg.debugger.plugin.objects.link = color.palette.green
color.bg.debugger.plugin.resources.stale = color.palette.lightgray
color.bg.debugger.plugin.resources.error = color.palette.lightpink
color.bg.debugger.plugin.resources.error = color.palette.lightcoral
color.fg.debugger.value.stale = color.palette.gray
color.fg.debugger.value.stale.selected = color.palette.lightgray
color.fg.debugger.value.changed = color.palette.red
color.fg.debugger.value.changed.selected = color.palette.lightcoral
color.debugger.plugin.resources.register.marker = color.palette.lightgreen
color.debugger.plugin.resources.register.marker = color.palette.palegreen
color.debugger.plugin.resources.register.stale = color.fg.debugger.value.stale
color.debugger.plugin.resources.register.stale.selected = color.fg.debugger.value.stale.selected
color.debugger.plugin.resources.register.changed = color.fg.debugger.value.changed
@ -54,7 +55,7 @@ color.debugger.plugin.resources.watch.changed.selected = color.fg.debugger.value
color.debugger.plugin.resources.value.changed = color.palette.red
color.debugger.plugin.resources.value.changed.selected = color.palette.lightcoral
color.debugger.plugin.resources.pcode.counter = color.palette.lightgreen
color.debugger.plugin.resources.pcode.counter = color.palette.palegreen
color.debugger.plugin.resources.breakpoint.marker.enabled = color.palette.lightsteelblue
color.debugger.plugin.resources.breakpoint.marker.disabled = color.debugger.plugin.resources.breakpoint.marker.enabled

View File

@ -114,3 +114,10 @@ font.listing.header = SansSerif-PLAIN-11
color.bg.highlight.listing.diff = #4D4D2A
// non-palette colors; these are currently ugly, but bright enough for easy scanning
color.bg.listing.highlighter.default = yellow
color.bg.listing.highlighter.scoped.read = darkorange
color.bg.listing.highlighter.scoped.write = lime

View File

@ -32,10 +32,6 @@ color.bg.interpreterconsole = color.bg
color.fg.interpreterconsole = color.fg
color.fg.interpreterconsole.error = color.fg.error
color.bg.listing.highlighter.default = color.palette.yellow
color.bg.listing.highlighter.scoped.read = color.palette.darkkhaki
color.bg.listing.highlighter.scoped.write = color.palette.lightgreen
color.bg.markerservice = color.bg
color.bg.search.highlight = color.bg.highlight
@ -170,11 +166,6 @@ font.plugin.tips.label = font.plugin.tips[BOLD]
// custom; if changed, check: decompiler
color.bg.undefined = #3A2A48
// non-palette colors; these are currently ugly, but bright enough for easy scanning
color.bg.listing.highlighter.default = yellow
color.bg.listing.highlighter.scoped.read = darkorange
color.bg.listing.highlighter.scoped.write = lime
color.fg.analysis.options.prototype.selected = color.palette.crimson

View File

@ -18,6 +18,7 @@ package ghidra.app.decompiler.component.margin;
import java.awt.*;
import java.math.BigInteger;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import docking.util.GraphicsUtils;
@ -36,6 +37,10 @@ public class LineNumberDecompilerMarginProvider extends JPanel
private LayoutPixelIndexMap pixmap;
private LayoutModel model;
public LineNumberDecompilerMarginProvider() {
setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 2));
}
@Override
public void setProgram(Program program, LayoutModel model, LayoutPixelIndexMap pixmap) {
setLayoutManager(model);
@ -86,6 +91,8 @@ public class LineNumberDecompilerMarginProvider extends JPanel
}
int lastLine = model.getNumIndexes().intValueExact();
int width = getFontMetrics(getFont()).stringWidth(Integer.toString(lastLine));
Insets insets = getInsets();
width += insets.left + insets.right;
setPreferredSize(new Dimension(Math.max(16, width), 0));
invalidate();
}
@ -93,6 +100,9 @@ public class LineNumberDecompilerMarginProvider extends JPanel
@Override
public void paint(Graphics g) {
super.paint(g);
Insets insets = getInsets();
int rightEdge = getWidth() - insets.right;
Rectangle visible = getVisibleRect();
BigInteger startIdx = pixmap.getIndex(visible.y);
BigInteger endIdx = pixmap.getIndex(visible.y + visible.height);
@ -100,8 +110,7 @@ public class LineNumberDecompilerMarginProvider extends JPanel
for (BigInteger i = startIdx; i.compareTo(endIdx) <= 0; i = i.add(BigInteger.ONE)) {
String text = i.add(BigInteger.ONE).toString();
int width = g.getFontMetrics().stringWidth(text);
GraphicsUtils.drawString(this, g, text, getWidth() - width,
pixmap.getPixel(i) + ascent);
GraphicsUtils.drawString(this, g, text, rightEdge - width, pixmap.getPixel(i) + ascent);
}
}
}

View File

@ -7,7 +7,7 @@ color.fg.plugin.functiongraph.label.non.picked = color.fg.disabled
color.bg.plugin.functiongraph.vertex.group = color.palette.greenyellow
color.bg.plugin.functiongraph.vertex.entry = color.palette.lightgreen
color.bg.plugin.functiongraph.vertex.exit = color.palette.lightred
color.bg.plugin.functiongraph.vertex.exit = color.palette.lightcoral
color.bg.plugin.functiongraph.vertex.picked = color.palette.yellow
color.bg.plugin.functiongraph.edge.fall.through = color.flowtype.fall.through

View File

@ -34,7 +34,6 @@ color.palette.lightcoral = lightcoral
color.palette.lightgray = rgb(192, 192, 192)
color.palette.lightgreen = rgb(127, 255, 127)
color.palette.lightpink = lightpink
color.palette.lightred = rgb(255, 127, 127)
color.palette.lightskyblue = lightskyblue
color.palette.lightsteelblue = lightsteelblue
color.palette.lime = lime
@ -78,36 +77,35 @@ color.palette.blueviolet = violet
color.palette.crimson = lightcoral
color.palette.cyan = cadetblue // not sure; can change
color.palette.darkgray = dimgray
color.palette.darkgreen = #70a070
color.palette.darkgreen = #70A070
color.palette.darkkhaki = olive
color.palette.darkorange = orange
color.palette.darkred = salmon // not sure; can change
color.palette.gray = lightslategray
color.palette.green = #70c070
color.palette.green = #70C070
color.palette.greenyellow = darkolivegreen
color.palette.indigo = #c070c0
color.palette.indigo = #C070C0
color.palette.khaki = tan // not sure; can change
color.palette.lavender = darkorchid
color.palette.lemonchiffon = khaki // not sure; can change
color.palette.lightcoral = #9A4B4B // between firebrick and indianred
color.palette.lightcoral = #713232 // somewhat eggplant
color.palette.lightgreen = darkgreen
color.palette.lightgray = darkgray
color.palette.lightpink = indianred // not sure; can change
color.palette.lightgray = #4E4E4E
color.palette.lightskyblue = #065475 // not sure; need to be dark when used as a bg color
color.palette.lightsteelblue = royalblue
color.palette.lightsteelblue = #2D3D5B
color.palette.lime = mediumseagreen
color.palette.magenta = plum
color.palette.maroon = lightcoral
color.palette.mistyrose = pink // not sure; can change
color.palette.navy = lightblue
color.palette.olive = #c0c080
color.palette.orange = #ffa070
color.palette.olive = #C0C080
color.palette.orange = #FFA070
color.palette.palegreen = darkslategray
color.palette.pink = #ff80a0
color.palette.pink = #FF80A0
color.palette.purple = mediumpurple
color.palette.red = indianred
color.palette.saddlebrown = burlywood // not sure; can change
color.palette.silver = dimgray // not sure; this may need to be darker
color.palette.silver = #383838
color.palette.tan = #635542 // less saturated tan
color.palette.teal = mediumseagreen
color.palette.yellow = moccasin