1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-11 02:05:39 +02:00

[Bug 205486] [terminal] create a switch for scroll locking

This commit is contained in:
Martin Oberhuber 2010-06-04 13:38:01 +00:00
parent 6cabe5791d
commit 121000b4f0

View file

@ -92,12 +92,8 @@ public class TextCanvas extends GridCanvas {
public void terminalDataChanged() { public void terminalDataChanged() {
if(isDisposed()) if(isDisposed())
return; return;
// scroll to end (unless scroll lock is active)
scrollToEnd(); scrollToEnd();
// make sure the scroll area is correct:
if (!fScrollLock) {
scrollY(getVerticalBar());
scrollX(getHorizontalBar());
}
} }
}); });
// let the cursor blink if the text canvas gets the focus... // let the cursor blink if the text canvas gets the focus...
@ -250,14 +246,8 @@ public class TextCanvas extends GridCanvas {
setVirtualExtend(getCols()*getCellWidth(),getRows()*getCellHeight()); setVirtualExtend(getCols()*getCellWidth(),getRows()*getCellHeight());
setRedraw(false); setRedraw(false);
try { try {
// scroll to end // scroll to end (unless scroll lock is active)
scrollToEnd(); scrollToEnd();
// make sure the scroll area is correct:
if (!fScrollLock) {
scrollY(getVerticalBar());
scrollX(getHorizontalBar());
}
getParent().layout(); getParent().layout();
} finally { } finally {
setRedraw(true); setRedraw(true);
@ -273,6 +263,9 @@ public class TextCanvas extends GridCanvas {
if(v.y!=-y) { if(v.y!=-y) {
setVirtualOrigin(v.x,y); setVirtualOrigin(v.x,y);
} }
// make sure the scroll area is correct:
scrollY(getVerticalBar());
scrollX(getHorizontalBar());
} }
} }
/** /**