From 5dcfe99b831f17c69b27e41c345f7e3d25a5727f Mon Sep 17 00:00:00 2001 From: Arseny Chernyaev Date: Thu, 21 Nov 2019 17:08:38 +0300 Subject: [PATCH] IDEA-CR-55648: always use actual debugger node presentation during update of 'Pin to top' icon on hover GitOrigin-RevId: d0610b66bd33dfcef8f917895490fec44948964c --- .../impl/pinned/items/XDebuggerPinToTopManager.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/pinned/items/XDebuggerPinToTopManager.kt b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/pinned/items/XDebuggerPinToTopManager.kt index c4249f44c314..20eef9493bcb 100644 --- a/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/pinned/items/XDebuggerPinToTopManager.kt +++ b/platform/xdebugger-impl/src/com/intellij/xdebugger/impl/pinned/items/XDebuggerPinToTopManager.kt @@ -51,20 +51,21 @@ open class XDebuggerPinToTopManager { if (!pinnedValue.canBePinned() || isItemPinned(node)) { return } - val valuePresentation = valueNode.valuePresentation ?: return - val hasChildren = !valueNode.isLeaf - val oldIcon = valueNode.icon + var oldIcon = valueNode.icon val changeIconLifetime = Disposable { - if (node.icon != oldIcon) { - node.setPresentation(oldIcon, valuePresentation, hasChildren) + val xValuePresentation = node.valuePresentation + if (node.icon == PlatformDebuggerImplIcons.PinToTop.UnpinnedItem && xValuePresentation != null) { + node.setPresentation(oldIcon, xValuePresentation, !node.isLeaf) } myActiveNode = null } myActiveNode = node myPinToTopIconAlarm.addRequest({ - node.setPresentation(PlatformDebuggerImplIcons.PinToTop.UnpinnedItem, valuePresentation, hasChildren) + val xValuePresentation = node.valuePresentation ?: return@addRequest + oldIcon = node.icon //update icon with actual value + node.setPresentation(PlatformDebuggerImplIcons.PinToTop.UnpinnedItem, xValuePresentation, !node.isLeaf) }, DEFAULT_ICON_DELAY) myNodeHoverLifetime = changeIconLifetime Disposer.register(lifetimeHolder, changeIconLifetime)