Skip to content

Commit 5c91df6

Browse files
Fix toolkit connection dropdown hiding when panel is small (#4933)
1 parent aa3ba5e commit 5c91df6

File tree

4 files changed

+28
-7
lines changed

4 files changed

+28
-7
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Fix toolkit connection dropdown getting hidden when panel width is small."
4+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
package software.aws.toolkits.jetbrains.core.explorer
4+
5+
import com.intellij.openapi.actionSystem.ActionToolbar
6+
7+
fun setToolbarLayout(toolbar: ActionToolbar) {
8+
toolbar.layoutPolicy = ActionToolbar.NOWRAP_LAYOUT_POLICY
9+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Copyright 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
package software.aws.toolkits.jetbrains.core.explorer
4+
5+
import com.intellij.openapi.actionSystem.ActionToolbar
6+
import com.intellij.openapi.actionSystem.toolbarLayout.ToolbarLayoutStrategy
7+
8+
fun setToolbarLayout(toolbar: ActionToolbar) {
9+
toolbar.layoutStrategy = ToolbarLayoutStrategy.NOWRAP_STRATEGY
10+
}

plugins/toolkit/jetbrains-core/src/software/aws/toolkits/jetbrains/core/explorer/AwsToolkitExplorerToolWindow.kt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ package software.aws.toolkits.jetbrains.core.explorer
66
import com.intellij.icons.AllIcons
77
import com.intellij.openapi.actionSystem.ActionManager
88
import com.intellij.openapi.actionSystem.ActionPlaces
9-
import com.intellij.openapi.actionSystem.ActionToolbar
109
import com.intellij.openapi.actionSystem.AnAction
1110
import com.intellij.openapi.actionSystem.AnActionEvent
1211
import com.intellij.openapi.actionSystem.DefaultActionGroup
@@ -65,12 +64,11 @@ class AwsToolkitExplorerToolWindow(
6564
val group = CredsComboBoxActionGroup(project)
6665

6766
toolbar = BorderLayoutPanel().apply {
68-
addToCenter(
69-
ActionManager.getInstance().createActionToolbar(ActionPlaces.TOOLBAR, group, true).apply {
70-
layoutPolicy = ActionToolbar.AUTO_LAYOUT_POLICY
71-
setTargetComponent(this@AwsToolkitExplorerToolWindow)
72-
}.component
73-
)
67+
val actionToolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.TOOLBAR, group, true).apply {
68+
setTargetComponent(this@AwsToolkitExplorerToolWindow)
69+
}
70+
setToolbarLayout(actionToolbar)
71+
addToCenter(actionToolbar.component)
7472

7573
val actionManager = ActionManager.getInstance()
7674
val rightActionGroup = DefaultActionGroup(

0 commit comments

Comments
 (0)