diff --git a/.changes/next-release/bugfix-d171c0a8-83d8-4dab-8499-d402939d7c38.json b/.changes/next-release/bugfix-d171c0a8-83d8-4dab-8499-d402939d7c38.json new file mode 100644 index 00000000000..a9fb14c862e --- /dev/null +++ b/.changes/next-release/bugfix-d171c0a8-83d8-4dab-8499-d402939d7c38.json @@ -0,0 +1,4 @@ +{ + "type" : "bugfix", + "description" : "Fix toolkit connection dropdown getting hidden when panel width is small." +} \ No newline at end of file diff --git a/plugins/toolkit/jetbrains-core/src-233/software/aws/toolkits/jetbrains/core/explorer/ActionToolbarLayoutUtil.kt b/plugins/toolkit/jetbrains-core/src-233/software/aws/toolkits/jetbrains/core/explorer/ActionToolbarLayoutUtil.kt new file mode 100644 index 00000000000..787c88a807f --- /dev/null +++ b/plugins/toolkit/jetbrains-core/src-233/software/aws/toolkits/jetbrains/core/explorer/ActionToolbarLayoutUtil.kt @@ -0,0 +1,9 @@ +// Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +package software.aws.toolkits.jetbrains.core.explorer + +import com.intellij.openapi.actionSystem.ActionToolbar + +fun setToolbarLayout(toolbar: ActionToolbar) { + toolbar.layoutPolicy = ActionToolbar.NOWRAP_LAYOUT_POLICY +} diff --git a/plugins/toolkit/jetbrains-core/src-241+/software/aws/toolkits/jetbrains/core/explorer/ActionToolbarLayoutUtil.kt b/plugins/toolkit/jetbrains-core/src-241+/software/aws/toolkits/jetbrains/core/explorer/ActionToolbarLayoutUtil.kt new file mode 100644 index 00000000000..7914ef24f02 --- /dev/null +++ b/plugins/toolkit/jetbrains-core/src-241+/software/aws/toolkits/jetbrains/core/explorer/ActionToolbarLayoutUtil.kt @@ -0,0 +1,10 @@ +// Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +package software.aws.toolkits.jetbrains.core.explorer + +import com.intellij.openapi.actionSystem.ActionToolbar +import com.intellij.openapi.actionSystem.toolbarLayout.ToolbarLayoutStrategy + +fun setToolbarLayout(toolbar: ActionToolbar) { + toolbar.layoutStrategy = ToolbarLayoutStrategy.NOWRAP_STRATEGY +} diff --git a/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/explorer/AwsToolkitExplorerToolWindow.kt b/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/explorer/AwsToolkitExplorerToolWindow.kt index 50005b881bf..a09e3a0baae 100644 --- a/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/explorer/AwsToolkitExplorerToolWindow.kt +++ b/plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/explorer/AwsToolkitExplorerToolWindow.kt @@ -6,7 +6,6 @@ package software.aws.toolkits.jetbrains.core.explorer import com.intellij.icons.AllIcons import com.intellij.openapi.actionSystem.ActionManager import com.intellij.openapi.actionSystem.ActionPlaces -import com.intellij.openapi.actionSystem.ActionToolbar import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.DefaultActionGroup @@ -65,12 +64,11 @@ class AwsToolkitExplorerToolWindow( val group = CredsComboBoxActionGroup(project) toolbar = BorderLayoutPanel().apply { - addToCenter( - ActionManager.getInstance().createActionToolbar(ActionPlaces.TOOLBAR, group, true).apply { - layoutPolicy = ActionToolbar.AUTO_LAYOUT_POLICY - setTargetComponent(this@AwsToolkitExplorerToolWindow) - }.component - ) + val actionToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.TOOLBAR, group, true).apply { + setTargetComponent(this@AwsToolkitExplorerToolWindow) + } + setToolbarLayout(actionToolbar) + addToCenter(actionToolbar.component) val actionManager = ActionManager.getInstance() val rightActionGroup = DefaultActionGroup(