Improve status bar tooltip
This commit is contained in:
@ -22,16 +22,21 @@ export default class KanbnStatusBarItem {
|
|||||||
const text = [
|
const text = [
|
||||||
`$(project) ${status.tasks}`
|
`$(project) ${status.tasks}`
|
||||||
];
|
];
|
||||||
const tooltip = [
|
let tooltip = [];
|
||||||
`${status.tasks} task${status.tasks === 1 ? '' : 's'}`
|
if (status.tasks > 0) {
|
||||||
];
|
tooltip = [
|
||||||
if ('startedTasks' in status) {
|
`${status.tasks} task${status.tasks === 1 ? '' : 's'}`
|
||||||
text.push(`$(play) ${status.startedTasks}`);
|
];
|
||||||
tooltip.push(`${status.startedTasks} started task${status.startedTasks === 1 ? '' : 's'}`);
|
if ('startedTasks' in status && status.startedTasks! > 0) {
|
||||||
}
|
text.push(`$(play) ${status.startedTasks}`);
|
||||||
if ('completedTasks' in status) {
|
tooltip.push(`${status.startedTasks} started task${status.startedTasks === 1 ? '' : 's'}`);
|
||||||
text.push(`$(check) ${status.completedTasks}`);
|
}
|
||||||
tooltip.push(`${status.completedTasks} completed task${status.completedTasks === 1 ? '' : 's'}`);
|
if ('completedTasks' in status && status.completedTasks! > 0) {
|
||||||
|
text.push(`$(check) ${status.completedTasks}`);
|
||||||
|
tooltip.push(`${status.completedTasks} completed task${status.completedTasks === 1 ? '' : 's'}`);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
tooltip.push('No tasks');
|
||||||
}
|
}
|
||||||
this._statusBarItem.text = text.join(' ');
|
this._statusBarItem.text = text.join(' ');
|
||||||
this._statusBarItem.tooltip = tooltip.join('\n');
|
this._statusBarItem.tooltip = tooltip.join('\n');
|
||||||
|
Reference in New Issue
Block a user