From c76c723af28331d271b22a687dd4717fe537fa8f Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Fri, 30 Dec 2011 14:04:23 +0100 Subject: [PATCH] option to prevent hiding choose by name popups on focus loss (IDEA-61092) --- .../ide/util/gotoByName/ChooseByNamePopup.java | 5 +++-- .../src/com/intellij/ide/ui/UISettings.java | 1 + .../intellij/ide/ui/AppearanceConfigurable.java | 5 +++++ .../src/com/intellij/ide/ui/AppearancePanel.form | 16 ++++++++++++---- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNamePopup.java b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNamePopup.java index f3ceb2251888..136fa200c5d2 100644 --- a/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNamePopup.java +++ b/platform/lang-impl/src/com/intellij/ide/util/gotoByName/ChooseByNamePopup.java @@ -17,6 +17,7 @@ package com.intellij.ide.util.gotoByName; import com.intellij.featureStatistics.FeatureUsageTracker; +import com.intellij.ide.ui.UISettings; import com.intellij.openapi.application.ModalityState; import com.intellij.openapi.keymap.KeymapUtil; import com.intellij.openapi.project.Project; @@ -95,8 +96,8 @@ public class ChooseByNamePopup extends ChooseByNameBase implements ChooseByNameP myShowListForEmptyPattern = showListForEmptyPattern; } - protected boolean isCloseByFocusLost(){ - return true; + protected boolean isCloseByFocusLost() { + return UISettings.getInstance().HIDE_NAVIGATION_ON_FOCUS_LOSS; } protected void showList() { diff --git a/platform/platform-api/src/com/intellij/ide/ui/UISettings.java b/platform/platform-api/src/com/intellij/ide/ui/UISettings.java index 002ed1227387..f0d0f878410f 100644 --- a/platform/platform-api/src/com/intellij/ide/ui/UISettings.java +++ b/platform/platform-api/src/com/intellij/ide/ui/UISettings.java @@ -89,6 +89,7 @@ public class UISettings implements PersistentStateComponent, Exporta public boolean SORT_LOOKUP_ELEMENTS_LEXICOGRAPHICALLY = false; public int MAX_LOOKUP_WIDTH = 500; public int MAX_LOOKUP_LIST_HEIGHT = 11; + public boolean HIDE_NAVIGATION_ON_FOCUS_LOSS = true; /** * Defines whether asterisk is shown on modified editor tab or not diff --git a/platform/platform-impl/src/com/intellij/ide/ui/AppearanceConfigurable.java b/platform/platform-impl/src/com/intellij/ide/ui/AppearanceConfigurable.java index 40656f0db866..72f3a1ebb430 100644 --- a/platform/platform-impl/src/com/intellij/ide/ui/AppearanceConfigurable.java +++ b/platform/platform-impl/src/com/intellij/ide/ui/AppearanceConfigurable.java @@ -22,6 +22,7 @@ import com.intellij.openapi.ui.ComboBox; import com.intellij.openapi.util.Comparing; import com.intellij.openapi.util.IconLoader; import com.intellij.openapi.wm.ex.WindowManagerEx; +import com.intellij.ui.components.JBCheckBox; import com.intellij.util.ui.UIUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -144,6 +145,7 @@ public class AppearanceConfigurable extends BaseConfigurable implements Searchab } settings.OVERRIDE_NONIDEA_LAF_FONTS = myComponent.myOverrideLAFFonts.isSelected(); settings.MOVE_MOUSE_ON_DEFAULT_BUTTON = myComponent.myMoveMouseOnDefaultButtonCheckBox.isSelected(); + settings.HIDE_NAVIGATION_ON_FOCUS_LOSS = myComponent.myHideNavigationPopupsCheckBox.isSelected(); update |= settings.DISABLE_MNEMONICS != myComponent.myDisableMnemonics.isSelected(); settings.DISABLE_MNEMONICS = myComponent.myDisableMnemonics.isSelected(); @@ -202,6 +204,7 @@ public class AppearanceConfigurable extends BaseConfigurable implements Searchab myComponent.myHideIconsInQuickNavigation.setSelected(settings.SHOW_ICONS_IN_QUICK_NAVIGATION); myComponent.myMoveMouseOnDefaultButtonCheckBox.setSelected(settings.MOVE_MOUSE_ON_DEFAULT_BUTTON); + myComponent.myHideNavigationPopupsCheckBox.setSelected(settings.HIDE_NAVIGATION_ON_FOCUS_LOSS); myComponent.myLafComboBox.setSelectedItem(LafManager.getInstance().getCurrentLookAndFeel()); myComponent.myOverrideLAFFonts.setSelected(settings.OVERRIDE_NONIDEA_LAF_FONTS); myComponent.myDisableMnemonics.setSelected(settings.DISABLE_MNEMONICS); @@ -244,6 +247,7 @@ public class AppearanceConfigurable extends BaseConfigurable implements Searchab isModified |= myComponent.myHideIconsInQuickNavigation.isSelected() != settings.SHOW_ICONS_IN_QUICK_NAVIGATION; isModified |= myComponent.myMoveMouseOnDefaultButtonCheckBox.isSelected() != settings.MOVE_MOUSE_ON_DEFAULT_BUTTON; + isModified |= myComponent.myHideNavigationPopupsCheckBox.isSelected() != settings.HIDE_NAVIGATION_ON_FOCUS_LOSS; isModified |= !Comparing.equal(myComponent.myLafComboBox.getSelectedItem(), LafManager.getInstance().getCurrentLookAndFeel()); if (WindowManagerEx.getInstanceEx().isAlphaModeSupported()) { isModified |= myComponent.myEnableAlphaModeCheckBox.isSelected() != settings.ENABLE_ALPHA_MODE; @@ -310,6 +314,7 @@ public class AppearanceConfigurable extends BaseConfigurable implements Searchab private JCheckBox myHideIconsInQuickNavigation; private JCheckBox myCbDisplayIconsInMenu; private JCheckBox myDisableMnemonics; + private JBCheckBox myHideNavigationPopupsCheckBox; public MyComponent() { ActionListener updater = new ActionListener() { diff --git a/platform/platform-impl/src/com/intellij/ide/ui/AppearancePanel.form b/platform/platform-impl/src/com/intellij/ide/ui/AppearancePanel.form index 808f209fb151..ecad82e26ff7 100644 --- a/platform/platform-impl/src/com/intellij/ide/ui/AppearancePanel.form +++ b/platform/platform-impl/src/com/intellij/ide/ui/AppearancePanel.form @@ -16,7 +16,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -77,7 +77,7 @@ - + @@ -137,7 +137,7 @@ - + @@ -169,6 +169,14 @@ + + + + + + + +