mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[PyCharm] Jupyter (refactor): Improved cell--actions-toolbar positioning in case of different code analysis toolbars. #PY-87213 Ready For Merge
GitOrigin-RevId: 839e056a2e72004c80e7a101ca3747f7b96f33ac
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7d2b340e0e
commit
0ce301dd5e
@@ -69,11 +69,11 @@ internal class EditorCellActionsToolbarController(
|
||||
}
|
||||
}.cancelOnDispose(this)
|
||||
|
||||
editor.scrollingModel.addVisibleAreaListener({
|
||||
if (!NotebookSettings.getInstance().cellToolbarStickyVisible) return@addVisibleAreaListener
|
||||
val targetComponent = toolbar?.targetComponent ?: return@addVisibleAreaListener
|
||||
updateToolbarPosition(targetComponent)
|
||||
}, this)
|
||||
editor.scrollingModel.addVisibleAreaListener {
|
||||
if (!NotebookSettings.getInstance().cellToolbarStickyVisible) return@addVisibleAreaListener
|
||||
val targetComponent = toolbar?.targetComponent ?: return@addVisibleAreaListener
|
||||
updateToolbarPosition(targetComponent)
|
||||
}
|
||||
|
||||
cell.isSelected.afterDistinctChange(this) {
|
||||
updateToolbarVisibility()
|
||||
@@ -210,8 +210,11 @@ internal class EditorCellActionsToolbarController(
|
||||
// We have also EditorInspectionsActionToolbar in the top right editor corner, and we want to protect from overlap.
|
||||
val statusComponent = (editor.scrollPane as? JBScrollPane)?.statusComponent
|
||||
if (statusComponent != null) {
|
||||
if (result.intersectsEvenIfEmpty(statusComponent.bounds.apply { y += editor.contentComponent.visibleRect.y })) {
|
||||
result.y += statusComponent.height
|
||||
val statusComponentLocation = SwingUtilities.convertPoint(statusComponent, Point(0, 0), editor.contentComponent)
|
||||
val statusComponentBounds = Rectangle(statusComponentLocation, statusComponent.size)
|
||||
|
||||
if (result.intersectsEvenIfEmpty(statusComponentBounds)) {
|
||||
result.y = statusComponentBounds.y + statusComponentBounds.height
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user