From a985efb03303823fa4f96e0579caaf9b874134eb Mon Sep 17 00:00:00 2001 From: Ethan Hou Date: Tue, 19 May 2026 15:42:22 +0800 Subject: [PATCH] fix: Remove LONG_POPUP_WIDTH constant from model hover. --- .../microsoft/copilot/eclipse/ui/swt/DropdownPopup.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/DropdownPopup.java b/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/DropdownPopup.java index 0b4b6e81..7b9dc2f0 100644 --- a/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/DropdownPopup.java +++ b/com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/DropdownPopup.java @@ -49,7 +49,6 @@ class DropdownPopup { private static final int BORDER_ARC = 8; private static final int MAX_VISIBLE_ITEMS = 15; private static final int SHORT_POPUP_WIDTH = 250; - private static final int LONG_POPUP_WIDTH = 300; private static Image checkIcon; @@ -518,11 +517,9 @@ private void openHoverShell(DropdownItem item, Composite anchorItem) { hoverShell.pack(); Point hoverSize = hoverShell.getSize(); - int width = hoverSize.x <= SHORT_POPUP_WIDTH ? SHORT_POPUP_WIDTH : LONG_POPUP_WIDTH; - if (width != hoverSize.x) { - // Recompute size at the target width so wrapped labels lay out correctly. - hoverSize = hoverShell.computeSize(width, SWT.DEFAULT); - hoverSize.x = width; + if (hoverSize.x < SHORT_POPUP_WIDTH) { + hoverSize = hoverShell.computeSize(SHORT_POPUP_WIDTH, SWT.DEFAULT); + hoverSize.x = SHORT_POPUP_WIDTH; hoverShell.setSize(hoverSize); }