Skip to content

Commit d8a43c4

Browse files
authored
fix: Remove LONG_POPUP_WIDTH constant from model hover. (#234)
1 parent 0e9c0b8 commit d8a43c4

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

  • com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt

com.microsoft.copilot.eclipse.ui/src/com/microsoft/copilot/eclipse/ui/swt/DropdownPopup.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ class DropdownPopup {
4949
private static final int BORDER_ARC = 8;
5050
private static final int MAX_VISIBLE_ITEMS = 15;
5151
private static final int SHORT_POPUP_WIDTH = 250;
52-
private static final int LONG_POPUP_WIDTH = 300;
5352

5453
private static Image checkIcon;
5554

@@ -518,11 +517,9 @@ private void openHoverShell(DropdownItem item, Composite anchorItem) {
518517

519518
hoverShell.pack();
520519
Point hoverSize = hoverShell.getSize();
521-
int width = hoverSize.x <= SHORT_POPUP_WIDTH ? SHORT_POPUP_WIDTH : LONG_POPUP_WIDTH;
522-
if (width != hoverSize.x) {
523-
// Recompute size at the target width so wrapped labels lay out correctly.
524-
hoverSize = hoverShell.computeSize(width, SWT.DEFAULT);
525-
hoverSize.x = width;
520+
if (hoverSize.x < SHORT_POPUP_WIDTH) {
521+
hoverSize = hoverShell.computeSize(SHORT_POPUP_WIDTH, SWT.DEFAULT);
522+
hoverSize.x = SHORT_POPUP_WIDTH;
526523
hoverShell.setSize(hoverSize);
527524
}
528525

0 commit comments

Comments
 (0)