IDEA-299337 Tool window buttons: make it possible to move More icon

GitOrigin-RevId: 43b8b41b62605cf69bd75b3e79dc4e79e9bd39ac
This commit is contained in:
Alexander Lobas
2023-07-01 10:18:47 +00:00
committed by intellij-monorepo-bot
parent 45ff05b5f1
commit 555d12b0d2
2 changed files with 3 additions and 8 deletions
@@ -82,7 +82,7 @@ class ToolWindowManagerStateImpl : ToolWindowManagerState {
}
element.addContent(recentState)
}
if (moreButton !== ToolWindowAnchor.LEFT) {
if (moreButton != ToolWindowAnchor.LEFT) {
element.addContent(Element(MORE_BUTTON_TAG).setAttribute("side", moreButton.toString()))
}
return element
@@ -63,8 +63,7 @@ internal class MoreSquareStripeButton(toolWindowToolbar: ToolWindowToolbar,
}
override fun isAvailable(project: Project): Boolean {
return super.isAvailable(project) && ToolWindowManagerEx.getInstanceEx(
project).getMoreButtonSide() == side
return super.isAvailable(project) && ToolWindowManagerEx.getInstanceEx(project).getMoreButtonSide() == side
}
override fun checkSkipPressForEvent(e: MouseEvent) = e.button != MouseEvent.BUTTON1
@@ -109,11 +108,7 @@ internal abstract class AbstractMoreSquareStripeButton(action: AnAction) : Abstr
override fun update() {
super.update()
val project = dataContext.getData(CommonDataKeys.PROJECT)
if (project == null) {
return
}
val available = isAvailable(project)
val available = project != null && isAvailable(project)
myPresentation.isEnabledAndVisible = available
isEnabled = available