mirror of
https://github.com/Microsoft/vscode
synced 2024-09-29 07:51:27 +00:00
Wip
This commit is contained in:
parent
4a8ef1b244
commit
583053113b
|
@ -73,22 +73,14 @@ export class CellDiffPlaceholderElement extends Disposable {
|
|||
localize('hiddenCells', '{0} hidden cells', placeholder.hiddenCells.length);
|
||||
templateData.placeholder.innerText = text;
|
||||
|
||||
const handler = (e: MouseEvent) => {
|
||||
this._register(DOM.addDisposableListener(templateData.placeholder, 'dblclick', (e: MouseEvent) => {
|
||||
if (e.button !== 0) {
|
||||
return;
|
||||
}
|
||||
e.preventDefault();
|
||||
placeholder.showHiddenCells();
|
||||
};
|
||||
templateData.placeholder.addEventListener('dblclick', handler);
|
||||
this._register({
|
||||
dispose: () => {
|
||||
templateData.placeholder.removeEventListener('dblclick', handler);
|
||||
}
|
||||
});
|
||||
this._register(templateData.marginOverlay.onAction(() => {
|
||||
placeholder.showHiddenCells();
|
||||
}));
|
||||
this._register(templateData.marginOverlay.onAction(() => placeholder.showHiddenCells()));
|
||||
templateData.marginOverlay.show();
|
||||
}
|
||||
}
|
||||
|
@ -1399,9 +1391,7 @@ export class ModifiedElement extends AbstractElementRenderer {
|
|||
override buildBody(): void {
|
||||
super.buildBody();
|
||||
if (this.cell.unchangedCells) {
|
||||
this._register(this.templateData.marginOverlay.onAction(() => {
|
||||
this.cell.hideUnchangedCells();
|
||||
}));
|
||||
this._register(this.templateData.marginOverlay.onAction(() => this.cell.hideUnchangedCells()));
|
||||
this.templateData.marginOverlay.show();
|
||||
} else {
|
||||
this.templateData.marginOverlay.hide();
|
||||
|
@ -1852,9 +1842,7 @@ export class CollapsedCellOverlayWidget extends Disposable implements IDiffCellM
|
|||
|
||||
this._nodes.root.style.display = 'none';
|
||||
container.appendChild(this._nodes.root);
|
||||
this._register(DOM.addDisposableListener(this._nodes.content.children[0], 'click', () => {
|
||||
this._action.fire();
|
||||
}));
|
||||
this._register(DOM.addDisposableListener(this._nodes.content.children[0], 'click', () => this._action.fire()));
|
||||
}
|
||||
public show() {
|
||||
this._nodes.root.style.display = 'block';
|
||||
|
|
|
@ -49,9 +49,7 @@ export abstract class DiffElementViewModelBase extends Disposable {
|
|||
) {
|
||||
super();
|
||||
|
||||
this._register(this.editorEventDispatcher.onDidChangeLayout(e => {
|
||||
this._layoutInfoEmitter.fire({ outerWidth: true });
|
||||
}));
|
||||
this._register(this.editorEventDispatcher.onDidChangeLayout(e => this._layoutInfoEmitter.fire({ outerWidth: true })));
|
||||
}
|
||||
|
||||
abstract layoutChange(): void;
|
||||
|
@ -78,14 +76,13 @@ export class DiffElementPlaceholderViewModel extends DiffElementViewModelBase {
|
|||
|
||||
}
|
||||
get totalHeight() {
|
||||
return 50;
|
||||
return 24;
|
||||
}
|
||||
getHeight(lineHeight: number): number {
|
||||
getHeight(_: number): number {
|
||||
return this.totalHeight;
|
||||
}
|
||||
override layoutChange(): void {
|
||||
//
|
||||
console.log('layout change in placeholder');
|
||||
}
|
||||
showHiddenCells() {
|
||||
this._unfoldHiddenCells.fire();
|
||||
|
@ -222,9 +219,7 @@ export abstract class DiffElementCellViewModelBase extends DiffElementViewModelB
|
|||
this.metadataFoldingState = PropertyFoldingState.Collapsed;
|
||||
this.outputFoldingState = PropertyFoldingState.Collapsed;
|
||||
|
||||
this._register(this.editorEventDispatcher.onDidChangeLayout(e => {
|
||||
this._layoutInfoEmitter.fire({ outerWidth: true });
|
||||
}));
|
||||
this._register(this.editorEventDispatcher.onDidChangeLayout(e => this._layoutInfoEmitter.fire({ outerWidth: true })));
|
||||
}
|
||||
|
||||
layoutChange() {
|
||||
|
|
|
@ -436,9 +436,6 @@
|
|||
background: var(--vscode-diffEditor-unchangedRegionBackground);
|
||||
color: var(--vscode-diffEditor-unchangedRegionForeground);
|
||||
min-height: 24px;
|
||||
|
||||
/* font-size: 13px;
|
||||
line-height: 14px; */
|
||||
}
|
||||
|
||||
.notebook-text-diff-editor .cell-placeholder-body div.diff-hidden-cells .center {
|
||||
|
|
|
@ -102,7 +102,6 @@ export class CellDiffPlaceholderRenderer implements IListRenderer<DiffElementPla
|
|||
|
||||
disposeTemplate(templateData: CellDiffPlaceholderRenderTemplate): void {
|
||||
templateData.container.innerText = '';
|
||||
templateData.elementDisposables.dispose();
|
||||
}
|
||||
|
||||
disposeElement(element: DiffElementPlaceholderViewModel, index: number, templateData: CellDiffPlaceholderRenderTemplate): void {
|
||||
|
|
Loading…
Reference in a new issue