mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-27 10:37:38 +01:00
Fix #121927
Remove new inner span in statusbar items, also switch to just codicon syntax
This commit is contained in:
+6
-6
@@ -11,8 +11,8 @@ import { themeColorFromId, ThemeIcon } from 'vs/platform/theme/common/themeServi
|
||||
import { ICellVisibilityChangeEvent, NotebookVisibleCellObserver } from 'vs/workbench/contrib/notebook/browser/contrib/statusBar/notebookVisibleCellObserver';
|
||||
import { ICellViewModel, INotebookEditor, INotebookEditorContribution } from 'vs/workbench/contrib/notebook/browser/notebookBrowser';
|
||||
import { registerNotebookContribution } from 'vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
|
||||
import { cellStatusIconSuccess, cellStatusIconError } from 'vs/workbench/contrib/notebook/browser/notebookEditorWidget';
|
||||
import { successStateIcon, errorStateIcon, pendingStateIcon, executingStateIcon } from 'vs/workbench/contrib/notebook/browser/notebookIcons';
|
||||
import { cellStatusIconError, cellStatusIconSuccess } from 'vs/workbench/contrib/notebook/browser/notebookEditorWidget';
|
||||
import { executingStateIcon, pendingStateIcon } from 'vs/workbench/contrib/notebook/browser/notebookIcons';
|
||||
import { NotebookViewModel } from 'vs/workbench/contrib/notebook/browser/viewModel/notebookViewModel';
|
||||
import { CellStatusbarAlignment, INotebookCellStatusBarItem, NotebookCellExecutionState } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||
|
||||
@@ -122,16 +122,16 @@ class ExecutionStateCellStatusBarHelper extends Disposable {
|
||||
private _getItemForState(runState: NotebookCellExecutionState | undefined, lastRunSuccess: boolean | undefined): INotebookCellStatusBarItem | undefined {
|
||||
if (runState === NotebookCellExecutionState.Idle && lastRunSuccess) {
|
||||
return <INotebookCellStatusBarItem>{
|
||||
icon: successStateIcon,
|
||||
iconColor: themeColorFromId(cellStatusIconSuccess),
|
||||
text: '$(notebook-state-success)',
|
||||
color: themeColorFromId(cellStatusIconSuccess),
|
||||
tooltip: localize('notebook.cell.status.success', "Success"),
|
||||
alignment: CellStatusbarAlignment.Left,
|
||||
priority: Number.MAX_SAFE_INTEGER
|
||||
};
|
||||
} else if (runState === NotebookCellExecutionState.Idle && !lastRunSuccess) {
|
||||
return <INotebookCellStatusBarItem>{
|
||||
icon: errorStateIcon,
|
||||
iconColor: themeColorFromId(cellStatusIconError),
|
||||
text: '$(notebook-state-error)',
|
||||
color: themeColorFromId(cellStatusIconError),
|
||||
tooltip: localize('notebook.cell.status.failed', "Failed"),
|
||||
alignment: CellStatusbarAlignment.Left,
|
||||
priority: Number.MAX_SAFE_INTEGER
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
import * as DOM from 'vs/base/browser/dom';
|
||||
import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
import { renderIcon } from 'vs/base/browser/ui/iconLabel/iconLabels';
|
||||
import { SimpleIconLabel } from 'vs/base/browser/ui/iconLabel/simpleIconLabel';
|
||||
import { WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from 'vs/base/common/actions';
|
||||
import { toErrorMessage } from 'vs/base/common/errorMessage';
|
||||
@@ -180,20 +179,8 @@ class CellStatusBarItem extends Disposable {
|
||||
color;
|
||||
};
|
||||
|
||||
if (this._itemModel.icon) {
|
||||
const iconContainer = renderIcon(this._itemModel.icon);
|
||||
if (this._itemModel.iconColor) {
|
||||
const colorResult = resolveColor(this._itemModel.iconColor);
|
||||
iconContainer.style.color = colorResult || '';
|
||||
}
|
||||
|
||||
this.container.appendChild(iconContainer);
|
||||
}
|
||||
|
||||
if (this._itemModel.text) {
|
||||
const textContainer = $('span', undefined);
|
||||
new SimpleIconLabel(textContainer).text = this._itemModel.text.replace(/\n/g, ' ');
|
||||
this.container.appendChild(textContainer);
|
||||
new SimpleIconLabel(this.container).text = this._itemModel.text.replace(/\n/g, ' ');
|
||||
}
|
||||
|
||||
if (this._itemModel.color) {
|
||||
|
||||
@@ -18,12 +18,12 @@ import { IAccessibilityInformation } from 'vs/platform/accessibility/common/acce
|
||||
import { RawContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IEditorModel } from 'vs/platform/editor/common/editor';
|
||||
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
|
||||
import { ThemeColor } from 'vs/platform/theme/common/themeService';
|
||||
import { IEditorInput, IRevertOptions, ISaveOptions } from 'vs/workbench/common/editor';
|
||||
import { NotebookTextModel } from 'vs/workbench/contrib/notebook/common/model/notebookTextModel';
|
||||
import { ThemeColor, ThemeIcon } from 'vs/platform/theme/common/themeService';
|
||||
import { IWorkingCopyBackupMeta } from 'vs/workbench/services/workingCopy/common/workingCopyBackup';
|
||||
import { NotebookSelector } from 'vs/workbench/contrib/notebook/common/notebookSelector';
|
||||
import { ICellRange } from 'vs/workbench/contrib/notebook/common/notebookRange';
|
||||
import { NotebookSelector } from 'vs/workbench/contrib/notebook/common/notebookSelector';
|
||||
import { IWorkingCopyBackupMeta } from 'vs/workbench/services/workingCopy/common/workingCopyBackup';
|
||||
|
||||
export enum CellKind {
|
||||
Markdown = 1,
|
||||
@@ -814,9 +814,7 @@ export interface INotebookCellStatusBarItem {
|
||||
readonly alignment: CellStatusbarAlignment;
|
||||
readonly priority?: number;
|
||||
readonly text?: string;
|
||||
readonly icon?: ThemeIcon;
|
||||
readonly color?: string | ThemeColor;
|
||||
readonly iconColor?: string | ThemeColor;
|
||||
readonly backgroundColor?: string | ThemeColor;
|
||||
readonly tooltip?: string;
|
||||
readonly command?: string | Command;
|
||||
|
||||
Reference in New Issue
Block a user