[UI, Bookmarks] IJPL-242950 Make the toolbar always visible

Because the value can only be true or null (for a popup) now,
remove it and replace with the isPopup property.

Reviewed at IJ-CR-209740.

(cherry picked from commit 83f158bb6fb46ccbe6e41b83135280a76b3119a3)

GitOrigin-RevId: a3c853519ddccce99e5a5649a7ed66d1755bd11c
This commit is contained in:
Sergei Tachenov
2026-08-07 08:58:50 +00:00
committed by intellij-monorepo-bot
parent 558fbf6029
commit 53b70f6010
3 changed files with 3 additions and 6 deletions
@@ -28,7 +28,7 @@ internal class ShowLineBookmarksAction : DumbAwareAction() {
override fun actionPerformed(event: AnActionEvent) {
val project = event.project ?: return
val panel = BookmarksView(project, null)
val panel = BookmarksView(project, isPopup = true)
panel.preferredSize = JBUI.DialogSizes.large()
val popup = JBPopupFactory.getInstance()
@@ -59,15 +59,13 @@ import java.awt.event.FocusEvent
import java.awt.event.FocusListener
import javax.swing.tree.TreePath
class BookmarksView(val project: Project, showToolbar: Boolean?)
class BookmarksView(val project: Project, val isPopup: Boolean)
: Disposable, UiDataProvider, OccurenceNavigator, OnePixelSplitter(false, .3f, .1f, .9f) {
companion object {
val BOOKMARKS_VIEW: DataKey<BookmarksView> = DataKey.create("BOOKMARKS_VIEW")
}
val isPopup: Boolean = showToolbar == null
fun interface EditSourceListener { fun onEditSource() }
private val editSourceListeners: MutableList<EditSourceListener> = mutableListOf()
@@ -1,7 +1,6 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.ide.bookmark.ui
import com.intellij.ide.actions.ToggleToolbarAction.isToolbarVisible
import com.intellij.openapi.actionSystem.ex.ActionUtil
import com.intellij.openapi.project.DumbAware
import com.intellij.openapi.project.Project
@@ -19,7 +18,7 @@ internal class BookmarksViewFactory : DumbAware, ToolWindowFactory, ToolWindowMa
override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) {
val manager = toolWindow.contentManager
val panel = BookmarksView(project, isToolbarVisible(toolWindow, project)).also { it.orientation = orientation.get() }
val panel = BookmarksView(project, isPopup = false).also { it.orientation = orientation.get() }
manager.addContent(manager.factory.createContent(panel, null, false).apply { isCloseable = false })
project.messageBus.connect(manager).subscribe(ToolWindowManagerListener.TOPIC, this)
toolWindow.helpId = "bookmarks.tool.window.help"