mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-18440 Python consoles with scrollbar constantly twitching on repaint (quickfix with diff support)
This commit is contained in:
@@ -272,7 +272,7 @@ public class JBViewport extends JViewport implements ZoomableViewport {
|
||||
|
||||
private static void updateBorder(Component view) {
|
||||
if (view instanceof JTable) return; // tables are not supported yet
|
||||
if (view instanceof JList || view instanceof JTree || view instanceof JComponent && Registry.is("ide.scroll.align.component")) {
|
||||
if (view instanceof JComponent) {
|
||||
JComponent component = (JComponent)view;
|
||||
Border border = component.getBorder();
|
||||
if (border instanceof ViewBorder) return; // already set
|
||||
@@ -364,7 +364,7 @@ public class JBViewport extends JViewport implements ZoomableViewport {
|
||||
if (va == Alignment.LEFT) {
|
||||
insets.left += vsb.getWidth();
|
||||
}
|
||||
else if (va == Alignment.RIGHT && !SystemInfo.isMac) {
|
||||
else if (va == Alignment.RIGHT && isAlignmentNeeded(view)) {
|
||||
insets.right += vsb.getWidth();
|
||||
}
|
||||
}
|
||||
@@ -375,7 +375,7 @@ public class JBViewport extends JViewport implements ZoomableViewport {
|
||||
if (ha == Alignment.TOP) {
|
||||
insets.top += hsb.getHeight();
|
||||
}
|
||||
else if (ha == Alignment.BOTTOM && !SystemInfo.isMac) {
|
||||
else if (ha == Alignment.BOTTOM && isAlignmentNeeded(view)) {
|
||||
insets.bottom += hsb.getHeight();
|
||||
}
|
||||
}
|
||||
@@ -383,5 +383,9 @@ public class JBViewport extends JViewport implements ZoomableViewport {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isAlignmentNeeded(JComponent view) {
|
||||
return !SystemInfo.isMac && (view instanceof JList || view instanceof JTree || Registry.is("ide.scroll.align.component"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user