mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
Cell collapse indicator tweaks
This commit is contained in:
parent
4b8e0c732c
commit
db170566b8
|
@ -1537,11 +1537,11 @@ registerAction2(class extends NotebookCellAction {
|
|||
primary: KeyChord(KeyCode.KEY_C, KeyCode.KEY_C),
|
||||
weight: KeybindingWeight.WorkbenchContrib
|
||||
},
|
||||
menu: {
|
||||
id: MenuId.NotebookCellTitle,
|
||||
when: ContextKeyExpr.and(NOTEBOOK_CELL_LIST_FOCUSED, NOTEBOOK_CELL_OUTPUT_COLLAPSED),
|
||||
group: '3_collapse',
|
||||
}
|
||||
// menu: {
|
||||
// id: MenuId.NotebookCellTitle,
|
||||
// when: ContextKeyExpr.and(NOTEBOOK_CELL_LIST_FOCUSED, NOTEBOOK_CELL_OUTPUT_COLLAPSED),
|
||||
// group: '3_collapse',
|
||||
// }
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -212,10 +212,13 @@
|
|||
}
|
||||
|
||||
.monaco-workbench .notebookOverlay > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .cell-collapsed-part {
|
||||
opacity: 0.9;
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
padding-left: 2px;
|
||||
}
|
||||
|
||||
.monaco-workbench .notebookOverlay > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .cell-collapsed-part .codicon {
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.monaco-workbench .notebookOverlay > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row.collapsed .notebook-folding-indicator,
|
||||
|
|
|
@ -1699,6 +1699,7 @@ registerThemingParticipant((theme, collector) => {
|
|||
if (cellToolbarSeperator) {
|
||||
collector.addRule(`.notebookOverlay .monaco-list-row > .monaco-toolbar { border: solid 1px ${cellToolbarSeperator}; }`);
|
||||
collector.addRule(`.notebookOverlay .cell-bottom-toolbar-container .action-item { border: solid 1px ${cellToolbarSeperator} }`);
|
||||
collector.addRule(`.monaco-workbench .notebookOverlay > .cell-list-container > .monaco-list > .monaco-scrollable-element > .monaco-list-rows > .monaco-list-row .cell-collapsed-part { border-bottom: solid 1px ${cellToolbarSeperator} }`);
|
||||
}
|
||||
|
||||
const focusedCellBackgroundColor = theme.getColor(focusedCellBackground);
|
||||
|
@ -1713,6 +1714,8 @@ registerThemingParticipant((theme, collector) => {
|
|||
collector.addRule(`.notebookOverlay .code-cell-row:not(.focused):hover .cell-focus-indicator,
|
||||
.notebookOverlay .code-cell-row:not(.focused).cell-output-hover .cell-focus-indicator,
|
||||
.notebookOverlay .markdown-cell-row:not(.focused):hover { background-color: ${cellHoverBackgroundColor} !important; }`);
|
||||
collector.addRule(`.notebookOverlay .code-cell-row:not(.focused).cell-output-hover .cell-collapsed-part,
|
||||
.notebookOverlay .code-cell-row:not(.focused):hover.collapsed .cell-collapsed-part { background-color: ${cellHoverBackgroundColor} !important; }`);
|
||||
}
|
||||
|
||||
const focusedCellBorderColor = theme.getColor(focusedCellBorder);
|
||||
|
|
|
@ -27,7 +27,6 @@ import { ITextModel } from 'vs/editor/common/model';
|
|||
import * as modes from 'vs/editor/common/modes';
|
||||
import { tokenizeLineToHTML } from 'vs/editor/common/modes/textToHtmlTokenizer';
|
||||
import { IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { localize } from 'vs/nls';
|
||||
import { MenuEntryActionViewItem, SubmenuEntryActionViewItem } from 'vs/platform/actions/browser/menuEntryActionViewItem';
|
||||
import { IMenu, MenuItemAction, SubmenuItemAction } from 'vs/platform/actions/common/actions';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
|
@ -37,7 +36,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
|||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { BOTTOM_CELL_TOOLBAR_HEIGHT, CELL_BOTTOM_MARGIN, EDITOR_BOTTOM_PADDING, EDITOR_TOOLBAR_HEIGHT, CELL_TOP_MARGIN, EDITOR_TOP_PADDING } from 'vs/workbench/contrib/notebook/browser/constants';
|
||||
import { BOTTOM_CELL_TOOLBAR_HEIGHT, CELL_BOTTOM_MARGIN, CELL_TOP_MARGIN, EDITOR_BOTTOM_PADDING, EDITOR_TOOLBAR_HEIGHT, EDITOR_TOP_PADDING } from 'vs/workbench/contrib/notebook/browser/constants';
|
||||
import { CancelCellAction, ChangeCellLanguageAction, ExecuteCellAction, INotebookCellActionContext } from 'vs/workbench/contrib/notebook/browser/contrib/coreActions';
|
||||
import { BaseCellRenderTemplate, CellCollapseState, CellEditState, CodeCellRenderTemplate, ICellViewModel, INotebookCellList, INotebookEditor, isCodeCellRenderTemplate, MarkdownCellRenderTemplate } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
|
||||
import { CellContextKeyManager } from 'vs/workbench/contrib/notebook/browser/view/renderers/cellContextKeys';
|
||||
|
@ -313,7 +312,7 @@ abstract class AbstractCellRenderer {
|
|||
}
|
||||
|
||||
protected setupCollapsedPart(templateData: BaseCellRenderTemplate): void {
|
||||
templateData.collapsedPart.textContent = localize('collapsedCellShowLabel', "Reveal");
|
||||
templateData.collapsedPart.innerHTML = renderCodicons('$(unfold)');
|
||||
DOM.hide(templateData.collapsedPart);
|
||||
templateData.disposables.add(domEvent(templateData.collapsedPart, DOM.EventType.CLICK)(() => {
|
||||
if (!templateData.currentRenderedCell) {
|
||||
|
|
|
@ -139,7 +139,7 @@ export class CodeCellViewModel extends BaseCellViewModel implements ICellViewMod
|
|||
};
|
||||
} else {
|
||||
const indicatorHeight = COLLAPSED_INDICATOR_HEIGHT + outputTotalHeight;
|
||||
const outputContainerOffset = COLLAPSED_INDICATOR_HEIGHT;
|
||||
const outputContainerOffset = CELL_TOP_MARGIN + COLLAPSED_INDICATOR_HEIGHT;
|
||||
const totalHeight = CELL_TOP_MARGIN + COLLAPSED_INDICATOR_HEIGHT + CELL_BOTTOM_MARGIN + BOTTOM_CELL_TOOLBAR_HEIGHT + outputTotalHeight;
|
||||
const bottomToolbarOffset = totalHeight - BOTTOM_CELL_TOOLBAR_HEIGHT - BOTTOM_CELL_TOOLBAR_OFFSET;
|
||||
|
||||
|
|
Loading…
Reference in a new issue