mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
GTW-6993 Fix Related symbols popup is shown in the wrong position in RD
In RD `guessBestPopupLocation` returns `ClientRelativePoint` which is processed in a special way to ensure popup position is properly calculated. Replacing this point with standard `RelativePoint` causes popup to be shown in the wrong position. In `GotoRelatedSymbolAction` however there is no need to replace the `ClientRelativePoint` with `RelativePoint` as `popupLocation.getPoint().translate` alters the actual point (not its copy) therefore `new RelativePoint` may be safely removed GitOrigin-RevId: 42d7d31e59a0c4129e91333344bc721ceb4be4ab
This commit is contained in:
committed by
intellij-monorepo-bot
parent
86b5a9a93d
commit
c33c4aa44f
@@ -46,7 +46,7 @@ public final class GotoRelatedSymbolAction extends AnAction {
|
||||
// it's calculated in advance because `NavigationUtil.collectRelatedItems` might be
|
||||
// calculated under a cancellable progress, and we can't use the data context anymore,
|
||||
// since it can't be reused between swing events
|
||||
RelativePoint popupLocation = JBPopupFactory.getInstance().guessBestPopupLocation(dataContext);
|
||||
final RelativePoint popupLocation = JBPopupFactory.getInstance().guessBestPopupLocation(dataContext);
|
||||
|
||||
List<GotoRelatedItem> items = NavigationUtil.collectRelatedItems(element, dataContext);
|
||||
if (items.isEmpty()) {
|
||||
@@ -54,7 +54,6 @@ public final class GotoRelatedSymbolAction extends AnAction {
|
||||
if (component instanceof EditorComponentImpl editor) {
|
||||
Point point = popupLocation.getPoint();
|
||||
point.translate(0, -editor.getEditor().getLineHeight());
|
||||
popupLocation = new RelativePoint(popupLocation.getComponent(), point);
|
||||
}
|
||||
|
||||
JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(LangBundle.message("hint.text.no.related.symbols"), MessageType.ERROR, null)
|
||||
|
||||
Reference in New Issue
Block a user