diff --git a/platform/platform-api/resources/messages/UIBundle.properties b/platform/platform-api/resources/messages/UIBundle.properties index aa5eb9c1ca97..8709f9306474 100644 --- a/platform/platform-api/resources/messages/UIBundle.properties +++ b/platform/platform-api/resources/messages/UIBundle.properties @@ -228,6 +228,8 @@ action.text.anchor.left=left action.text.anchor.left.capitalized=Left action.text.anchor.right=right action.text.anchor.right.capitalized=Right +action.text.anchor.none=none +action.text.anchor.none.capitalized=None checkbox.tree.accessible.name.checked=checked checkbox.tree.accessible.name.not.checked=not checked diff --git a/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowAnchor.java b/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowAnchor.java index f36142fb9045..7dbabd685d09 100644 --- a/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowAnchor.java +++ b/platform/platform-api/src/com/intellij/openapi/wm/ToolWindowAnchor.java @@ -16,6 +16,8 @@ public final class ToolWindowAnchor { public static final @NotNull ToolWindowAnchor LEFT = new ToolWindowAnchor("left", "action.text.anchor.left", "action.text.anchor.left.capitalized"); public static final @NotNull ToolWindowAnchor BOTTOM = new ToolWindowAnchor("bottom", "action.text.anchor.bottom", "action.text.anchor.bottom.capitalized"); public static final @NotNull ToolWindowAnchor RIGHT = new ToolWindowAnchor("right", "action.text.anchor.right", "action.text.anchor.right.capitalized"); + public static final @NotNull ToolWindowAnchor NONE = new ToolWindowAnchor("none", "action.text.anchor.none", "action.text.anchor.none.capitalized"); + private final @NotNull String myText; private final @NotNull String bundleKey; diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.kt b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.kt index f9def6d5983a..75da23c11662 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.kt +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowManagerImpl.kt @@ -1079,7 +1079,9 @@ open class ToolWindowManagerImpl(val project: Project) : ToolWindowManagerEx(), button.isSelected = windowInfoSnapshot.isVisible button.updatePresentation() addStripeButton(button, toolWindowPane.getStripeFor((contentFactory as? ToolWindowFactoryEx)?.anchor ?: info.anchor)) - toolWindow.largeStripeAnchor = button.toolWindow.largeStripeAnchor + + toolWindow.largeStripeAnchor = if (toolWindow.largeStripeAnchor == ToolWindowAnchor.NONE) task.anchor else toolWindow.largeStripeAnchor + // If preloaded info is visible or active then we have to show/activate the installed // tool window. This step has sense only for windows which are not in the auto hide // mode. But if tool window was active but its mode doesn't allow to activate it again diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowToolbarProvider.kt b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowToolbarProvider.kt index 9cb112b08b8c..fbeeb202b864 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowToolbarProvider.kt +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowToolbarProvider.kt @@ -12,7 +12,7 @@ open class ToolWindowToolbarProvider { * * Please ensure that registered toolwindow anchor matches [anchor]. */ - open fun defaultBottomToolwindows(project: Project, anchor: ToolWindowAnchor) = + open fun defaultToolWindows(project: Project, anchor: ToolWindowAnchor) = when (anchor) { LEFT -> listOf("Project", "Commit", "Structure") BOTTOM -> listOf("Version Control", "Problems View", "Terminal", "Event Log") diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowsPane.java b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowsPane.java index 1ea32f9df093..6e0214eb653e 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowsPane.java +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/ToolWindowsPane.java @@ -613,7 +613,7 @@ public final class ToolWindowsPane extends JBLayeredPane implements UISettingsLi ensureDefaultInitialized(project); - var largeStripeAnchor = setupDefaultLargeStripeAnchor(toolWindow); + var largeStripeAnchor = setupDefaultLargeStripeAnchor(toolWindow, anchor); if (largeStripeAnchor != null) anchor = largeStripeAnchor; windowInfo.setLargeStripeAnchor(anchor); @@ -629,8 +629,7 @@ public final class ToolWindowsPane extends JBLayeredPane implements UISettingsLi } @Nullable - private ToolWindowAnchor setupDefaultLargeStripeAnchor(@NotNull ToolWindow toolWindow) { - ToolWindowAnchor toolWindowAnchor = toolWindow.getAnchor(); + private ToolWindowAnchor setupDefaultLargeStripeAnchor(@NotNull ToolWindow toolWindow, @NotNull ToolWindowAnchor toolWindowAnchor) { if (toolWindowAnchor == ToolWindowAnchor.LEFT && myDefaultLeftButtons.contains(toolWindow.getId()) || toolWindowAnchor == ToolWindowAnchor.RIGHT && myDefaultRightButtons.contains(toolWindow.getId()) || toolWindowAnchor == ToolWindowAnchor.BOTTOM && myDefaultBottomButtons.contains(toolWindow.getId())) { @@ -646,9 +645,9 @@ public final class ToolWindowsPane extends JBLayeredPane implements UISettingsLi return; } - myDefaultLeftButtons = ToolWindowToolbarProvider.getInstance().defaultBottomToolwindows(project, ToolWindowAnchor.LEFT); - myDefaultRightButtons = ToolWindowToolbarProvider.getInstance().defaultBottomToolwindows(project, ToolWindowAnchor.RIGHT); - myDefaultBottomButtons = ToolWindowToolbarProvider.getInstance().defaultBottomToolwindows(project, ToolWindowAnchor.BOTTOM); + myDefaultLeftButtons = ToolWindowToolbarProvider.getInstance().defaultToolWindows(project, ToolWindowAnchor.LEFT); + myDefaultRightButtons = ToolWindowToolbarProvider.getInstance().defaultToolWindows(project, ToolWindowAnchor.RIGHT); + myDefaultBottomButtons = ToolWindowToolbarProvider.getInstance().defaultToolWindows(project, ToolWindowAnchor.BOTTOM); PropertiesComponent.getInstance(project).setValue(key, true); } diff --git a/platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowInfoImpl.kt b/platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowInfoImpl.kt index c175c76a4cb3..16e23446fc1f 100644 --- a/platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowInfoImpl.kt +++ b/platform/platform-impl/src/com/intellij/openapi/wm/impl/WindowInfoImpl.kt @@ -33,7 +33,7 @@ class WindowInfoImpl : Cloneable, WindowInfo, BaseState() { override var anchor by property(ToolWindowAnchor.LEFT) { it == ToolWindowAnchor.LEFT } @get:Attribute(converter = ToolWindowAnchorConverter::class) - override var largeStripeAnchor by property(ToolWindowAnchor.LEFT) { it == ToolWindowAnchor.LEFT } + override var largeStripeAnchor by property(ToolWindowAnchor.NONE) { it == ToolWindowAnchor.NONE } @get:Attribute("visibleOnLargeStripe") override var isVisibleOnLargeStripe by property(false)