Browse Source

Skip popup window installation for lightweight popups.

pull/154/head
weisj 5 years ago
parent
commit
84b36f3a2f
  1. 5
      core/src/main/java/com/github/weisj/darklaf/ui/DarkPopupFactory.java

5
core/src/main/java/com/github/weisj/darklaf/ui/DarkPopupFactory.java

@ -51,7 +51,8 @@ public class DarkPopupFactory extends PopupFactory {
String popupClassName = popup.getClass().getSimpleName(); String popupClassName = popup.getClass().getSimpleName();
boolean isLightWeight = popupClassName.endsWith("LightWeightPopup"); boolean isLightWeight = popupClassName.endsWith("LightWeightPopup");
boolean isMediumWeight = !isLightWeight && popupClassName.endsWith("MediumWeightPopup"); boolean isMediumWeight = !isLightWeight && popupClassName.endsWith("MediumWeightPopup");
boolean forceHeavy = (isMediumWeight || isLightWeight) && isJComponent boolean isHeavyWeight = !(isLightWeight || isMediumWeight);
boolean forceHeavy = !isHeavyWeight && isJComponent
&& Boolean.TRUE.equals(((JComponent) contents).getClientProperty(KEY_FORCE_HEAVYWEIGHT)); && Boolean.TRUE.equals(((JComponent) contents).getClientProperty(KEY_FORCE_HEAVYWEIGHT));
if (forceHeavy) { if (forceHeavy) {
// null owner forces a heavyweight popup. // null owner forces a heavyweight popup.
@ -64,7 +65,7 @@ public class DarkPopupFactory extends PopupFactory {
} }
Window window = SwingUtilities.getWindowAncestor(contents); Window window = SwingUtilities.getWindowAncestor(contents);
if (window != null && !isMediumWeight) { if (window != null && isHeavyWeight) {
boolean isFocusable = isJComponent boolean isFocusable = isJComponent
&& Boolean.TRUE.equals(((JComponent) contents).getClientProperty(KEY_FOCUSABLE_POPUP)); && Boolean.TRUE.equals(((JComponent) contents).getClientProperty(KEY_FOCUSABLE_POPUP));
boolean startHidden = isJComponent boolean startHidden = isJComponent

Loading…
Cancel
Save