GP-6142 - Hovers - Fixed default tootip padding bug

This commit is contained in:
dragonmacher
2025-11-19 17:00:55 -05:00
parent 8c39f94c8a
commit fd0902b14d
2 changed files with 13 additions and 17 deletions

View File

@@ -139,18 +139,16 @@ public class DataTypeListingHover extends AbstractConfigurableHover implements L
}
StringBuilder sb = new StringBuilder(HTMLUtilities.HTML);
sb.append("<TABLE>");
if (parent != null) {
DataType parentType = parent.getDataType();
sb.append(row("Parent: ", parentType.getDataTypePath()));
int offset = (int) data.getAddress().subtract(parent.getAddress());
sb.append(row("Offset: ", NumericUtilities.toHexString(offset)));
sb.append(row("Field Name: ", nameLoc.getFieldName()));
if (parentType instanceof Structure pst) {
DataTypeComponent dtc = pst.getComponentAt(offset);
String comment = dtc == null ? null : dtc.getComment();
if (comment != null) {
sb.append(row("Comment: ", comment));
}
DataType parentType = parent.getDataType();
sb.append(row("Parent: ", parentType.getDataTypePath()));
int offset = (int) data.getAddress().subtract(parent.getAddress());
sb.append(row("Offset: ", NumericUtilities.toHexString(offset)));
sb.append(row("Field Name: ", nameLoc.getFieldName()));
if (parentType instanceof Structure pst) {
DataTypeComponent dtc = pst.getComponentAt(offset);
String comment = dtc == null ? null : dtc.getComment();
if (comment != null) {
sb.append(row("Comment: ", comment));
}
}
sb.append("</TABLE>");

View File

@@ -38,8 +38,8 @@ import util.CollectionUtils;
* the window will be closed.
*/
public class PopupWindow {
private static final int X_PADDING = 25;
private static final int Y_PADDING = 25;
private static final int X_PADDING = 15;
private static final int Y_PADDING = 15;
private static final List<WeakReference<PopupWindow>> VISIBLE_POPUPS = new ArrayList<>();
public static void hideAllWindows() {
@@ -370,9 +370,7 @@ public class PopupWindow {
if (CollectionUtils.isAllNull(location, keepVisibleArea)) {
throw new NullPointerException("Both location and keepVisibleArea cannot be null");
}
if (keepVisibleArea == null) {
keepVisibleArea = new Rectangle(location, new Dimension(0, 0));
}
this.location = location;
this.source = source;
this.screenKeepVisibleArea = createScreenKeepVisibleArea(location, keepVisibleArea);