fix #155222. Adjust focus gutter indicator for markup cell. (#157286)

* fix #155222. Adjust focus gutter indicator for markup cell.

* 💄
This commit is contained in:
Peng Lyu 2022-08-05 12:00:13 -07:00 committed by GitHub
parent a97d84d375
commit 60c53f18dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -81,7 +81,7 @@ export class CellFocusIndicator extends CellPart {
this.bottom.domNode.style.transform = `translateY(${indicatorPostion.bottomIndicatorTop}px)`;
this.left.setHeight(indicatorPostion.verticalIndicatorHeight);
this.right.setHeight(indicatorPostion.verticalIndicatorHeight);
this.codeFocusIndicator.setHeight(indicatorPostion.verticalIndicatorHeight);
this.codeFocusIndicator.setHeight(indicatorPostion.verticalIndicatorHeight - this.getIndicatorTopMargin() * 2);
} else {
// code cell
const cell = element as CodeCellViewModel;
@ -99,13 +99,17 @@ export class CellFocusIndicator extends CellPart {
}
private updateFocusIndicatorsForTitleMenu(): void {
this.left.domNode.style.transform = `translateY(${this.getIndicatorTopMargin()}px)`;
this.right.domNode.style.transform = `translateY(${this.getIndicatorTopMargin()}px)`;
}
private getIndicatorTopMargin() {
const layoutInfo = this.notebookEditor.notebookOptions.getLayoutConfiguration();
if (this.titleToolbar.hasActions) {
this.left.domNode.style.transform = `translateY(${layoutInfo.editorToolbarHeight + layoutInfo.cellTopMargin}px)`;
this.right.domNode.style.transform = `translateY(${layoutInfo.editorToolbarHeight + layoutInfo.cellTopMargin}px)`;
return layoutInfo.editorToolbarHeight + layoutInfo.cellTopMargin;
} else {
this.left.domNode.style.transform = `translateY(${layoutInfo.cellTopMargin}px)`;
this.right.domNode.style.transform = `translateY(${layoutInfo.cellTopMargin}px)`;
return layoutInfo.cellTopMargin;
}
}
}