mirror of
https://github.com/Microsoft/vscode
synced 2024-08-26 20:39:37 +00:00
status - simplify by not needing element ID
This commit is contained in:
parent
a429fd1356
commit
959246744b
|
@ -60,11 +60,6 @@ export interface IStatusbarEntry {
|
||||||
* Wether to show a beak above the status bar entry.
|
* Wether to show a beak above the status bar entry.
|
||||||
*/
|
*/
|
||||||
readonly showBeak?: boolean;
|
readonly showBeak?: boolean;
|
||||||
|
|
||||||
/**
|
|
||||||
* An identifier to associate with the status bar entry DOM element.
|
|
||||||
*/
|
|
||||||
readonly elementId?: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IStatusbarService {
|
export interface IStatusbarService {
|
||||||
|
|
|
@ -324,13 +324,6 @@ class StatusBarEntryItem extends Disposable {
|
||||||
|
|
||||||
private render(entry: IStatusbarEntry): void {
|
private render(entry: IStatusbarEntry): void {
|
||||||
|
|
||||||
// Container
|
|
||||||
if (entry.elementId) {
|
|
||||||
this.container.id = entry.elementId;
|
|
||||||
} else if (this.container.id) {
|
|
||||||
delete this.container.id;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Text Container
|
// Text Container
|
||||||
let textContainer: HTMLElement;
|
let textContainer: HTMLElement;
|
||||||
if (entry.command) {
|
if (entry.command) {
|
||||||
|
|
|
@ -128,7 +128,6 @@ export class TaskStatusBarContributions extends Disposable implements IWorkbench
|
||||||
const problems = this.markerService.getStatistics();
|
const problems = this.markerService.getStatistics();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
elementId: 'task-statusbar-item',
|
|
||||||
text: this.getProblemsText(problems),
|
text: this.getProblemsText(problems),
|
||||||
tooltip: this.getProblemsTooltip(problems),
|
tooltip: this.getProblemsTooltip(problems),
|
||||||
command: 'workbench.action.tasks.toggleProblems'
|
command: 'workbench.action.tasks.toggleProblems'
|
||||||
|
|
|
@ -214,7 +214,7 @@ class WelcomeOverlay extends Disposable {
|
||||||
}
|
}
|
||||||
|
|
||||||
private updateProblemsKey() {
|
private updateProblemsKey() {
|
||||||
const problems = document.getElementById('task-statusbar-item');
|
const problems = document.querySelector('div[id="workbench.parts.statusbar"] .statusbar-item.left .octicon.octicon-warning');
|
||||||
const key = this._overlay.querySelector('.key.problems') as HTMLElement;
|
const key = this._overlay.querySelector('.key.problems') as HTMLElement;
|
||||||
if (problems instanceof HTMLElement) {
|
if (problems instanceof HTMLElement) {
|
||||||
const target = problems.getBoundingClientRect();
|
const target = problems.getBoundingClientRect();
|
||||||
|
|
|
@ -48,7 +48,7 @@ export class StatusBar {
|
||||||
case StatusBarElement.SYNC_STATUS:
|
case StatusBarElement.SYNC_STATUS:
|
||||||
return `${this.mainSelector} ${this.leftSelector} .octicon.octicon-sync`;
|
return `${this.mainSelector} ${this.leftSelector} .octicon.octicon-sync`;
|
||||||
case StatusBarElement.PROBLEMS_STATUS:
|
case StatusBarElement.PROBLEMS_STATUS:
|
||||||
return `${this.mainSelector} ${this.leftSelector} div[id="task-statusbar-item"]`;
|
return `${this.mainSelector} ${this.leftSelector} .octicon.octicon-error`;
|
||||||
case StatusBarElement.SELECTION_STATUS:
|
case StatusBarElement.SELECTION_STATUS:
|
||||||
return `${this.mainSelector} ${this.rightSelector} .editor-status-selection`;
|
return `${this.mainSelector} ${this.rightSelector} .editor-status-selection`;
|
||||||
case StatusBarElement.INDENTATION_STATUS:
|
case StatusBarElement.INDENTATION_STATUS:
|
||||||
|
|
Loading…
Reference in a new issue