From f9304ac9ddc4babc292cdccde5ad252103a13107 Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Wed, 13 Mar 2024 15:27:56 +0100 Subject: [PATCH] vcs: remove dead code GitOrigin-RevId: b885e17a86e0dc8ffb480608dbd8b6d601e23bae --- .../ui/branch/dashboard/BranchesTree.kt | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/plugins/git4idea/src/git4idea/ui/branch/dashboard/BranchesTree.kt b/plugins/git4idea/src/git4idea/ui/branch/dashboard/BranchesTree.kt index 3ac1670eb685..5147c7dd32a2 100644 --- a/plugins/git4idea/src/git4idea/ui/branch/dashboard/BranchesTree.kt +++ b/plugins/git4idea/src/git4idea/ui/branch/dashboard/BranchesTree.kt @@ -25,7 +25,6 @@ import com.intellij.ui.* import com.intellij.ui.hover.TreeHoverListener import com.intellij.ui.speedSearch.SpeedSearch import com.intellij.ui.speedSearch.SpeedSearchSupply -import com.intellij.util.EditSourceOnDoubleClickHandler.isToggleEvent import com.intellij.util.PlatformIcons import com.intellij.util.ThreeState import com.intellij.util.ui.UIUtil @@ -45,7 +44,6 @@ import org.jetbrains.annotations.NonNls import java.awt.Graphics import java.awt.GraphicsEnvironment import java.awt.datatransfer.Transferable -import java.awt.event.MouseEvent import java.util.* import java.util.function.Supplier import javax.swing.Icon @@ -58,7 +56,6 @@ import javax.swing.tree.TreePath internal class BranchesTreeComponent(project: Project) : DnDAwareTree() { - var doubleClickHandler: (BranchTreeNode) -> Unit = {} var searchField: SearchTextField? = null init { @@ -68,7 +65,6 @@ internal class BranchesTreeComponent(project: Project) : DnDAwareTree() { setShowsRootHandles(true) isOpaque = false isHorizontalAutoScrollingEnabled = false - installDoubleClickHandler() SmartExpander.installOn(this) TreeHoverListener.DEFAULT.addTo(this) initDnD() @@ -146,21 +142,6 @@ internal class BranchesTreeComponent(project: Project) : DnDAwareTree() { override fun hasFocus() = super.hasFocus() || searchField?.textEditor?.hasFocus() ?: false - private fun installDoubleClickHandler() { - object : DoubleClickListener() { - override fun onDoubleClick(e: MouseEvent): Boolean { - val clickPath = getClosestPathForLocation(e.x, e.y) ?: return false - val selectionPath = selectionPath - if (selectionPath == null || clickPath != selectionPath) return false - val node = (selectionPath.lastPathComponent as? BranchTreeNode) ?: return false - if (isToggleEvent(this@BranchesTreeComponent, e)) return false - - doubleClickHandler(node) - return true - } - }.installOn(this) - } - private fun initDnD() { if (!GraphicsEnvironment.isHeadless()) { transferHandler = BRANCH_TREE_TRANSFER_HANDLER