Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type" : "bugfix",
"description" : "Fix toolkit connection dropdown getting hidden when panel width is small."
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// 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

object ActionToolbarLayoutUtil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably dont need this object, it can be a standalone function

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it

fun setToolbarLayoutPolicy(toolbar: ActionToolbar) {
toolbar.layoutPolicy = ActionToolbar.NOWRAP_LAYOUT_POLICY
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// 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

object ActionToolbarLayoutUtil {
fun setToolbarLayoutPolicy(toolbar: ActionToolbar) {
toolbar.layoutStrategy = ToolbarLayoutStrategy.NOWRAP_STRATEGY
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
ActionToolbarLayoutUtil.setToolbarLayoutPolicy(actionToolbar)
addToCenter(actionToolbar.component)

val actionManager = ActionManager.getInstance()
val rightActionGroup = DefaultActionGroup(
Expand Down
Loading