@Override public void updateUI() { boolean isAmbiance = UIUtil.isUnderGTKLookAndFeel() && "Ambiance".equalsIgnoreCase(UIUtil.getGtkThemeName()); if (myTopLevel && !isAmbiance && UIUtil.GTK_AMBIANCE_TEXT_COLOR.equals(getForeground())) { setForeground(null); } if (UIUtil.isStandardMenuLAF()) { super.updateUI(); } else { setUI(IdeaMenuUI.createUI(this)); setFont(UIUtil.getMenuFont()); JPopupMenu popupMenu = getPopupMenu(); if (popupMenu != null) { popupMenu.updateUI(); } } if (myTopLevel && isAmbiance) { setForeground(UIUtil.GTK_AMBIANCE_TEXT_COLOR); } if (myTopLevel && UIUtil.isUnderGTKLookAndFeel()) { Insets insets = getInsets(); Insets newInsets = new Insets(insets.top, insets.left, insets.bottom, insets.right); if (insets.top + insets.bottom < 6) { newInsets.top = newInsets.bottom = 3; } if (insets.left + insets.right < 12) { newInsets.left = newInsets.right = 6; } if (!newInsets.equals(insets)) { setBorder(BorderFactory.createEmptyBorder(newInsets.top, newInsets.left, newInsets.bottom, newInsets.right)); } } }