[gtw] Ability to disable icons in list

GitOrigin-RevId: 2fba168dbf71869ce22838afa9330c2a12a38b29
This commit is contained in:
Denis Konoplev
2022-12-09 21:14:39 +01:00
committed by intellij-monorepo-bot
parent e1618ce0b5
commit 25f4c50e95

View File

@@ -71,6 +71,7 @@ public class PopupFactoryImpl extends JBPopupFactory {
* @see JBPopupFactory#guessBestPopupLocation(Editor)
*/
public static final Key<Point> ANCHOR_POPUP_POINT = Key.create("popup.anchor.point");
public static final Key<Boolean> DISABLE_ICON_IN_LIST = Key.create("popup.disable.icon.in.list");
private static final Logger LOG = Logger.getInstance(PopupFactoryImpl.class);
@@ -686,7 +687,9 @@ public class PopupFactoryImpl extends JBPopupFactory {
}
if (icon == null) icon = selectedIcon != null ? selectedIcon : EmptyIcon.create(myMaxIconWidth, myMaxIconHeight);
myIcon = icon;
boolean disableIcon = Boolean.TRUE.equals(presentation.getClientProperty(DISABLE_ICON_IN_LIST));
myIcon = disableIcon ? null : icon;
mySelectedIcon = selectedIcon;
myText = presentation.getText();
}
@@ -816,7 +819,10 @@ public class PopupFactoryImpl extends JBPopupFactory {
}
if (icon == null) icon = selectedIcon != null ? selectedIcon : EmptyIcon.create(myMaxIconWidth, myMaxIconHeight);
myIcon = icon;
boolean disableIcon = Boolean.TRUE.equals(presentation.getClientProperty(DISABLE_ICON_IN_LIST));
myIcon = disableIcon ? null : icon;
mySelectedIcon = selectedIcon;
myValue = presentation.getClientProperty(Presentation.PROP_VALUE);