IDEA-CR-55648: always use actual debugger node presentation during update of 'Pin to top' icon on hover

GitOrigin-RevId: d0610b66bd33dfcef8f917895490fec44948964c
This commit is contained in:
Arseny Chernyaev
2019-11-25 11:11:30 +00:00
committed by intellij-monorepo-bot
parent e13c5dfd97
commit 5dcfe99b83
@@ -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)