Skip to content

Commit 4fbb7bf

Browse files
committed
Merge remote-tracking branch 'origin/GP-3469_Dan_modulePcLabelsCollide' into patch
2 parents 7c89389 + 6132e41 commit 4fbb7bf

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/DebuggerLocationLabel.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,5 +199,6 @@ protected String computeLocationString() {
199199
public void updateLabel() {
200200
String label = computeLocationString();
201201
setText(label);
202+
setToolTipText(label);
202203
}
203204
}

Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/listing/DebuggerListingProvider.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@
1717

1818
import static ghidra.app.plugin.core.debug.gui.DebuggerResources.ICON_REGISTER_MARKER;
1919

20-
import java.awt.BorderLayout;
2120
import java.awt.Color;
21+
import java.awt.Dimension;
2222
import java.awt.event.MouseAdapter;
2323
import java.awt.event.MouseEvent;
2424
import java.lang.invoke.MethodHandles;
2525
import java.util.*;
2626
import java.util.stream.Collectors;
2727
import java.util.stream.Stream;
2828

29+
import javax.swing.Box;
2930
import javax.swing.JLabel;
30-
import javax.swing.JPanel;
3131
import javax.swing.event.ChangeEvent;
3232
import javax.swing.event.ChangeListener;
3333

@@ -208,6 +208,7 @@ public ForListingTrackingTrait() {
208208
protected void specChanged(LocationTrackingSpec spec) {
209209
updateTitle();
210210
trackingLabel.setText("");
211+
trackingLabel.setToolTipText("");
211212
trackingLabel.setForeground(Colors.FOREGROUND);
212213
trackingSpecChangeListeners.fire.locationTrackingSpecChanged(spec);
213214
}
@@ -333,9 +334,11 @@ public DebuggerListingProvider(DebuggerListingPlugin plugin, FormatManager forma
333334

334335
addDisplayListener(readsMemTrait.getDisplayListener());
335336

336-
JPanel northPanel = new JPanel(new BorderLayout());
337-
northPanel.add(locationLabel, BorderLayout.WEST);
338-
northPanel.add(trackingLabel, BorderLayout.EAST);
337+
Box northPanel = Box.createHorizontalBox();
338+
northPanel.add(locationLabel);
339+
locationLabel.setMinimumSize(new Dimension(0, 0));
340+
northPanel.add(Box.createGlue());
341+
northPanel.add(trackingLabel);
339342
this.setNorthComponent(northPanel);
340343
if (isConnected) {
341344
setTitle(DebuggerResources.TITLE_PROVIDER_LISTING);
@@ -1051,7 +1054,9 @@ protected ProgramLocation doMarkTrackedLocation() {
10511054
}
10521055

10531056
protected void goToAndUpdateTrackingLabel(TraceProgramView curView, ProgramLocation loc) {
1054-
trackingLabel.setText(trackingTrait.computeLabelText());
1057+
String labelText = trackingTrait.computeLabelText();
1058+
trackingLabel.setText(labelText);
1059+
trackingLabel.setToolTipText(labelText);
10551060
if (goTo(curView, loc)) {
10561061
trackingLabel.setForeground(Colors.FOREGROUND);
10571062
}

Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/memory/DebuggerMemoryBytesProvider.java

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
package ghidra.app.plugin.core.debug.gui.memory;
1717

1818
import java.awt.BorderLayout;
19+
import java.awt.Dimension;
1920
import java.awt.event.MouseAdapter;
2021
import java.awt.event.MouseEvent;
2122
import java.lang.invoke.MethodHandles;
2223
import java.math.BigInteger;
2324
import java.util.*;
2425

25-
import javax.swing.JLabel;
26-
import javax.swing.JPanel;
26+
import javax.swing.*;
2727

2828
import org.apache.commons.lang3.StringUtils;
2929

@@ -133,6 +133,7 @@ protected void locationTracked() {
133133
protected void specChanged(LocationTrackingSpec spec) {
134134
updateTitle();
135135
trackingLabel.setText("");
136+
trackingLabel.setToolTipText("");
136137
trackingLabel.setForeground(Colors.FOREGROUND);
137138
}
138139
}
@@ -206,9 +207,11 @@ protected DebuggerMemoryBytesProvider(PluginTool tool, DebuggerMemoryBytesPlugin
206207
createActions();
207208
addDisplayListener(readsMemTrait.getDisplayListener());
208209

209-
JPanel northPanel = new JPanel(new BorderLayout());
210-
northPanel.add(locationLabel, BorderLayout.WEST);
211-
northPanel.add(trackingLabel, BorderLayout.EAST);
210+
Box northPanel = Box.createHorizontalBox();
211+
northPanel.add(locationLabel);
212+
locationLabel.setMinimumSize(new Dimension(0, 0));
213+
northPanel.add(Box.createGlue());
214+
northPanel.add(trackingLabel);
212215
decorationComponent.add(northPanel, BorderLayout.NORTH);
213216

214217
goToTrait.goToCoordinates(current);
@@ -474,7 +477,9 @@ public AutoReadMemorySpec getAutoReadMemorySpec() {
474477
}
475478

476479
protected void goToAndUpdateTrackingLabel(TraceProgramView curView, ProgramLocation loc) {
477-
trackingLabel.setText(trackingTrait.computeLabelText());
480+
String labelText = trackingTrait.computeLabelText();
481+
trackingLabel.setText(labelText);
482+
trackingLabel.setToolTipText(labelText);
478483
if (goTo(curView, loc)) {
479484
trackingLabel.setForeground(Colors.FOREGROUND);
480485
}

0 commit comments

Comments
 (0)