Skip to content

Commit 200aef7

Browse files
author
Teffen
authored
Merge branch 'microsoft:main' into main
2 parents 9374a57 + b33ab96 commit 200aef7

File tree

17 files changed

+212
-164
lines changed

17 files changed

+212
-164
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"@microsoft/applicationinsights-web": "^2.6.4",
6262
"@parcel/watcher": "2.0.2",
6363
"@vscode/sqlite3": "4.0.12",
64-
"@vscode/sudo-prompt": "^9.3.0",
64+
"@vscode/sudo-prompt": "9.3.1",
6565
"@vscode/vscode-languagedetection": "1.0.21",
6666
"applicationinsights": "1.0.8",
6767
"cookie": "^0.4.1",

src/vs/base/browser/ui/checkbox/checkbox.css

+7-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
float: left;
99
cursor: pointer;
1010
overflow: hidden;
11-
opacity: 0.7;
1211
width: 20px;
1312
height: 20px;
13+
border-radius: 3px;
1414
border: 1px solid transparent;
1515
padding: 1px;
1616
box-sizing: border-box;
@@ -19,9 +19,12 @@
1919
-ms-user-select: none;
2020
}
2121

22-
.monaco-custom-checkbox:hover,
23-
.monaco-custom-checkbox.checked {
24-
opacity: 1;
22+
.monaco-custom-checkbox:hover {
23+
background-color: var(--vscode-inputOption-hoverBackground);
24+
}
25+
26+
.hc-black .monaco-custom-checkbox:hover {
27+
border: 1px dashed var(--vscode-focusBorder);
2528
}
2629

2730
.hc-black .monaco-custom-checkbox {

src/vs/base/browser/ui/checkbox/checkbox.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,9 @@ export class Checkbox extends Widget {
191191

192192
protected applyStyles(): void {
193193
if (this.domNode) {
194-
this.domNode.style.borderColor = this._checked && this._opts.inputActiveOptionBorder ? this._opts.inputActiveOptionBorder.toString() : 'transparent';
194+
this.domNode.style.borderColor = this._checked && this._opts.inputActiveOptionBorder ? this._opts.inputActiveOptionBorder.toString() : '';
195195
this.domNode.style.color = this._checked && this._opts.inputActiveOptionForeground ? this._opts.inputActiveOptionForeground.toString() : 'inherit';
196-
this.domNode.style.backgroundColor = this._checked && this._opts.inputActiveOptionBackground ? this._opts.inputActiveOptionBackground.toString() : 'transparent';
196+
this.domNode.style.backgroundColor = this._checked && this._opts.inputActiveOptionBackground ? this._opts.inputActiveOptionBackground.toString() : '';
197197
}
198198
}
199199

src/vs/platform/theme/common/colorRegistry.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ export const inputBackground = registerColor('input.background', { dark: '#3C3C3
225225
export const inputForeground = registerColor('input.foreground', { dark: foreground, light: foreground, hc: foreground }, nls.localize('inputBoxForeground', "Input box foreground."));
226226
export const inputBorder = registerColor('input.border', { dark: null, light: null, hc: contrastBorder }, nls.localize('inputBoxBorder', "Input box border."));
227227
export const inputActiveOptionBorder = registerColor('inputOption.activeBorder', { dark: '#007ACC00', light: '#007ACC00', hc: contrastBorder }, nls.localize('inputBoxActiveOptionBorder', "Border color of activated options in input fields."));
228-
export const inputActiveOptionBackground = registerColor('inputOption.activeBackground', { dark: transparent(focusBorder, 0.4), light: transparent(focusBorder, 0.2), hc: Color.transparent }, nls.localize('inputOption.activeBackground', "Background color of activated options in input fields."));
228+
export const inputActiveOptionHoverBackground = registerColor('inputOption.hoverBackground', { dark: '#5a5d5e80', light: '#b8b8b850', hc: null }, nls.localize('inputOption.hoverBackground', "Background color of activated options in input fields."));
229+
export const inputActiveOptionBackground = registerColor('inputOption.activeBackground', { dark: transparent(focusBorder, 0.4), light: transparent(focusBorder, 0.2), hc: Color.transparent }, nls.localize('inputOption.activeBackground', "Background hover color of options in input fields."));
229230
export const inputActiveOptionForeground = registerColor('inputOption.activeForeground', { dark: Color.white, light: Color.black, hc: null }, nls.localize('inputOption.activeForeground', "Foreground color of activated options in input fields."));
230231
export const inputPlaceholderForeground = registerColor('input.placeholderForeground', { light: transparent(foreground, 0.5), dark: transparent(foreground, 0.5), hc: transparent(foreground, 0.7) }, nls.localize('inputPlaceholderForeground', "Input box foreground color for placeholder text."));
231232

src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.ts

+17-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { Emitter, Event } from 'vs/base/common/event';
7-
import { Disposable, DisposableStore } from 'vs/base/common/lifecycle';
7+
import { DisposableStore } from 'vs/base/common/lifecycle';
88
import { deepClone } from 'vs/base/common/objects';
99
import { IEditorOptions, LineNumbersType } from 'vs/editor/common/config/editorOptions';
1010
import { localize } from 'vs/nls';
@@ -16,13 +16,13 @@ import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation
1616
import { Registry } from 'vs/platform/registry/common/platform';
1717
import { ActiveEditorContext } from 'vs/workbench/common/editor';
1818
import { INotebookCellToolbarActionContext, INotebookCommandContext, NotebookMultiCellAction, NOTEBOOK_ACTIONS_CATEGORY } from 'vs/workbench/contrib/notebook/browser/controller/coreActions';
19-
import { ICellViewModel, INotebookEditorDelegate, NOTEBOOK_CELL_LINE_NUMBERS, NOTEBOOK_EDITOR_FOCUSED } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
19+
import { CellViewModelStateChangeEvent, ICellViewModel, INotebookEditorDelegate, NOTEBOOK_CELL_LINE_NUMBERS, NOTEBOOK_EDITOR_FOCUSED } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
2020
import { NotebookEditor } from 'vs/workbench/contrib/notebook/browser/notebookEditor';
21+
import { CellPart } from 'vs/workbench/contrib/notebook/browser/view/cellParts/cellPart';
2122
import { NotebookCellInternalMetadata } from 'vs/workbench/contrib/notebook/common/notebookCommon';
2223
import { NotebookOptions } from 'vs/workbench/contrib/notebook/common/notebookOptions';
2324

24-
export class CellEditorOptions extends Disposable {
25-
25+
export class CellEditorOptions extends CellPart {
2626
private static fixedEditorOptions: IEditorOptions = {
2727
scrollBeyondLastLine: false,
2828
scrollbar: {
@@ -86,6 +86,19 @@ export class CellEditorOptions extends Disposable {
8686
this._value = this._computeEditorOptions();
8787
}
8888

89+
prepareLayout(): void {
90+
// nothing to read
91+
}
92+
updateLayoutNow(element: ICellViewModel): void {
93+
// nothing to update
94+
}
95+
96+
updateState(element: ICellViewModel, e: CellViewModelStateChangeEvent) {
97+
if (e.cellLineNumberChanged) {
98+
this.setLineNumbers(element.lineNumbers);
99+
}
100+
}
101+
89102
private _recomputeOptions(): void {
90103
this._value = this._computeEditorOptions();
91104
this._onDidChange.fire();

src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
// import * as DOM from 'vs/base/browser/dom';
77
import { FastDomNode } from 'vs/base/browser/fastDomNode';
8-
import { ICellViewModel, INotebookEditorDelegate } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
8+
import { CellViewModelStateChangeEvent, ICellViewModel, INotebookEditorDelegate } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
99
import { CellPart } from 'vs/workbench/contrib/notebook/browser/view/cellParts/cellPart';
1010
import { CodeCellViewModel } from 'vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel';
1111
import { CellKind } from 'vs/workbench/contrib/notebook/common/notebookCommon';
@@ -21,7 +21,7 @@ export class CellFocusIndicator extends CellPart {
2121
super();
2222
}
2323

24-
prepareRender(): void {
24+
prepareLayout(): void {
2525
// nothing to read
2626
}
2727

@@ -42,4 +42,8 @@ export class CellFocusIndicator extends CellPart {
4242
this.bottom.domNode.style.transform = `translateY(${cell.layoutInfo.totalHeight - bottomToolbarDimensions.bottomToolbarGap - layoutInfo.cellBottomMargin}px)`;
4343
}
4444
}
45+
46+
updateState(element: ICellViewModel, e: CellViewModelStateChangeEvent): void {
47+
// nothing to update
48+
}
4549
}

src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { ThemeIcon } from 'vs/platform/theme/common/themeService';
2424
import { ViewContainerLocation } from 'vs/workbench/common/views';
2525
import { IExtensionsViewPaneContainer, VIEWLET_ID as EXTENSION_VIEWLET_ID } from 'vs/workbench/contrib/extensions/common/extensions';
2626
import { INotebookCellActionContext } from 'vs/workbench/contrib/notebook/browser/controller/coreActions';
27-
import { ICellOutputViewModel, ICellViewModel, IInsetRenderOutput, INotebookEditorDelegate, IRenderOutput, JUPYTER_EXTENSION_ID, RenderOutputType } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
27+
import { CellViewModelStateChangeEvent, ICellOutputViewModel, ICellViewModel, IInsetRenderOutput, INotebookEditorDelegate, IRenderOutput, JUPYTER_EXTENSION_ID, RenderOutputType } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
2828
import { mimetypeIcon } from 'vs/workbench/contrib/notebook/browser/notebookIcons';
2929
import { CodeCellRenderTemplate } from 'vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon';
3030
import { getResizesObserver } from 'vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets';
@@ -593,7 +593,7 @@ export class CellOutputContainer extends CellPart {
593593
});
594594
}
595595

596-
prepareRender() {
596+
prepareLayout() {
597597
this._outputEntries.forEach(entry => {
598598
const index = this.viewCell.outputsViewModels.indexOf(entry.model);
599599
if (index >= 0) {
@@ -602,6 +602,11 @@ export class CellOutputContainer extends CellPart {
602602
});
603603
}
604604

605+
606+
updateState(element: ICellViewModel, e: CellViewModelStateChangeEvent): void {
607+
// nothing to update
608+
}
609+
605610
render(editorHeight: number) {
606611
if (this.viewCell.outputsViewModels.length > 0) {
607612
if (this.viewCell.layoutInfo.totalHeight !== 0 && this.viewCell.layoutInfo.editorHeight > editorHeight) {

src/vs/workbench/contrib/notebook/browser/view/cellParts/cellPart.ts

+9-4
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,25 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { Disposable } from 'vs/base/common/lifecycle';
7-
import { ICellViewModel } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
7+
import { CellViewModelStateChangeEvent, ICellViewModel } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
88

99
export abstract class CellPart extends Disposable {
1010
constructor() {
1111
super();
1212
}
1313

1414
/**
15-
* Read DOM
15+
* Perform DOM read operations to prepare for the list/cell layout update.
1616
*/
17-
abstract prepareRender(): void;
17+
abstract prepareLayout(): void;
1818

1919
/**
20-
* Update DOM based on layout info change of cell
20+
* Update DOM per cell layout info change
2121
*/
2222
abstract updateLayoutNow(element: ICellViewModel): void;
23+
24+
/**
25+
* Update per cell state change
26+
*/
27+
abstract updateState(element: ICellViewModel, e: CellViewModelStateChangeEvent): void;
2328
}

src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.ts

+29-19
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
*--------------------------------------------------------------------------------------------*/
55

66
import { ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar';
7-
import { Disposable } from 'vs/base/common/lifecycle';
8-
import { CellViewModelStateChangeEvent } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
7+
import { ICellViewModel, CellViewModelStateChangeEvent } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
8+
import { CellPart } from 'vs/workbench/contrib/notebook/browser/view/cellParts/cellPart';
99
import { CodeCellViewModel } from 'vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel';
1010
import { NotebookCellExecutionState, NotebookCellInternalMetadata } from 'vs/workbench/contrib/notebook/common/notebookCommon';
1111

12-
export class CellProgressBar extends Disposable {
12+
export class CellProgressBar extends CellPart {
1313
private readonly _progressBar: ProgressBar;
1414
private readonly _collapsedProgressBar: ProgressBar;
1515

@@ -25,6 +25,32 @@ export class CellProgressBar extends Disposable {
2525
this._collapsedProgressBar.hide();
2626
}
2727

28+
prepareLayout(): void {
29+
// nothing to read
30+
}
31+
32+
updateLayoutNow(element: ICellViewModel): void {
33+
// nothing to update
34+
}
35+
36+
updateState(element: ICellViewModel, e: CellViewModelStateChangeEvent): void {
37+
if (!e.inputCollapsedChanged) {
38+
return;
39+
}
40+
41+
if (element.isInputCollapsed) {
42+
this._progressBar.hide();
43+
if (element.internalMetadata.runState === NotebookCellExecutionState.Executing) {
44+
showProgressBar(this._collapsedProgressBar);
45+
}
46+
} else {
47+
this._collapsedProgressBar.hide();
48+
if (element.internalMetadata.runState === NotebookCellExecutionState.Executing) {
49+
showProgressBar(this._progressBar);
50+
}
51+
}
52+
}
53+
2854
updateForInternalMetadata(element: CodeCellViewModel, internalMetadata: NotebookCellInternalMetadata): void {
2955
const progressBar = element.isInputCollapsed ? this._collapsedProgressBar : this._progressBar;
3056
if (internalMetadata.runState === NotebookCellExecutionState.Executing && !internalMetadata.isPaused) {
@@ -33,22 +59,6 @@ export class CellProgressBar extends Disposable {
3359
progressBar.hide();
3460
}
3561
}
36-
37-
updateForCellState(e: CellViewModelStateChangeEvent, element: CodeCellViewModel): void {
38-
if (e.inputCollapsedChanged) {
39-
if (element.isInputCollapsed) {
40-
this._progressBar.hide();
41-
if (element.internalMetadata.runState === NotebookCellExecutionState.Executing) {
42-
showProgressBar(this._collapsedProgressBar);
43-
}
44-
} else {
45-
this._collapsedProgressBar.hide();
46-
if (element.internalMetadata.runState === NotebookCellExecutionState.Executing) {
47-
showProgressBar(this._progressBar);
48-
}
49-
}
50-
}
51-
}
5262
}
5363

5464
function showProgressBar(progressBar: ProgressBar): void {

src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
1818
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
1919
import { INotebookCellActionContext } from 'vs/workbench/contrib/notebook/browser/controller/coreActions';
2020
import { DeleteCellAction } from 'vs/workbench/contrib/notebook/browser/controller/editActions';
21-
import { ICellViewModel, INotebookEditorDelegate } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
21+
import { CellViewModelStateChangeEvent, ICellViewModel, INotebookEditorDelegate } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
2222
import { CodiconActionViewItem } from 'vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView';
2323
import { CellPart } from 'vs/workbench/contrib/notebook/browser/view/cellParts/cellPart';
2424

@@ -69,14 +69,19 @@ export class BetweenCellToolbar extends CellPart {
6969
this._betweenCellToolbar.context = context;
7070
}
7171

72-
prepareRender(): void {
72+
prepareLayout(): void {
7373
// nothing to read
7474
}
7575

7676
updateLayoutNow(element: ICellViewModel) {
7777
const bottomToolbarOffset = element.layoutInfo.bottomToolbarOffset;
7878
this._bottomCellToolbarContainer.style.transform = `translateY(${bottomToolbarOffset}px)`;
7979
}
80+
81+
82+
updateState(element: ICellViewModel, e: CellViewModelStateChangeEvent): void {
83+
// nothing to update
84+
}
8085
}
8186

8287

src/vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { INotificationService } from 'vs/platform/notification/common/notificati
2020
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
2121
import { IThemeService, ThemeColor } from 'vs/platform/theme/common/themeService';
2222
import { INotebookCellActionContext } from 'vs/workbench/contrib/notebook/browser/controller/coreActions';
23-
import { ICellViewModel } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
23+
import { CellViewModelStateChangeEvent, ICellViewModel } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
2424
import { CellPart } from 'vs/workbench/contrib/notebook/browser/view/cellParts/cellPart';
2525
import { CellStatusbarAlignment, INotebookCellStatusBarItem } from 'vs/workbench/contrib/notebook/common/notebookCommon';
2626

@@ -93,7 +93,7 @@ export class CellEditorStatusBar extends CellPart {
9393
}));
9494
}
9595

96-
prepareRender(): void {
96+
prepareLayout(): void {
9797
// nothing to read
9898
}
9999

@@ -112,6 +112,11 @@ export class CellEditorStatusBar extends CellPart {
112112
this.rightItems.forEach(item => item.maxWidth = maxItemWidth);
113113
}
114114

115+
116+
updateState(element: ICellViewModel, e: CellViewModelStateChangeEvent): void {
117+
// nothing to update
118+
}
119+
115120
private getMaxItemWidth() {
116121
return this.width / 2;
117122
}

0 commit comments

Comments
 (0)