make "View Mode" and "Move to" menus behave as "Resize"

Makes them disabled if there is no tool window in context, see IDEA-296551.

GitOrigin-RevId: 752b9f4e68f46fd5f21fa7774bc345528eac5286
This commit is contained in:
Gregory.Shrago
2022-06-24 00:31:53 +00:00
committed by intellij-monorepo-bot
parent 8e45c3ce3c
commit bfc2636b4d
2 changed files with 2 additions and 1 deletions
@@ -166,6 +166,7 @@ public final class ToolWindowMoveAction extends DumbAwareAction implements FusAw
@Override
public void update(@NotNull AnActionEvent e) {
ToolWindow toolWindow = getToolWindow(e);
e.getPresentation().setVisible(toolWindow != null);
e.getPresentation().setEnabled(toolWindow != null && !myAnchor.isApplied(toolWindow));
}
@@ -152,7 +152,7 @@ public class ToolWindowViewModeAction extends DumbAwareToggleAction implements F
@Override
public void update(@NotNull AnActionEvent e) {
super.update(e);
e.getPresentation().setEnabled(getToolWindow(e) != null);
e.getPresentation().setEnabledAndVisible(getToolWindow(e) != null);
}
@Override