Просмотр исходного кода

Renames icon references to octicon

main
Eric Amodio 7 лет назад
Родитель
Сommit
bcfa2cb4d7
3 измененных файлов: 8 добавлений и 8 удалений
  1. +3
    -3
      src/git/models/status.ts
  2. +3
    -3
      src/quickPicks/commitDetails.ts
  3. +2
    -2
      src/quickPicks/repoStatus.ts

+ 3
- 3
src/git/models/status.ts Просмотреть файл

@ -43,8 +43,8 @@ export class GitStatusFile implements IGitStatusFile {
return GitUri.getFormattedPath(this.fileName, separator);
}
getIcon() {
return getGitStatusIcon(this.status);
getOcticon() {
return getGitStatusOcticon(this.status);
}
get Uri(): Uri {
@ -70,6 +70,6 @@ const statusOcticonsMap = {
U: '$(question)'
};
export function getGitStatusIcon(status: GitStatusFileStatus, missing: string = GlyphChars.Space.repeat(4)): string {
export function getGitStatusOcticon(status: GitStatusFileStatus, missing: string = GlyphChars.Space.repeat(4)): string {
return statusOcticonsMap[status] || missing;
}

+ 3
- 3
src/quickPicks/commitDetails.ts Просмотреть файл

@ -4,7 +4,7 @@ import { commands, QuickPickOptions, TextDocumentShowOptions, Uri, window } from
import { Commands, CopyMessageToClipboardCommandArgs, CopyShaToClipboardCommandArgs, DiffDirectoryCommandCommandArgs, DiffWithPreviousCommandArgs, ShowQuickCommitDetailsCommandArgs, StashApplyCommandArgs, StashDeleteCommandArgs } from '../commands';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, KeyCommandQuickPickItem, OpenFileCommandQuickPickItem, OpenFilesCommandQuickPickItem, QuickPickItem } from './common';
import { GlyphChars } from '../constants';
import { getGitStatusIcon, GitCommit, GitLog, GitLogCommit, GitService, GitStashCommit, GitStatusFile, GitStatusFileStatus, GitUri, IGitCommitInfo, IGitStatusFile, RemoteResource } from '../gitService';
import { getGitStatusOcticon, GitCommit, GitLog, GitLogCommit, GitService, GitStashCommit, GitStatusFile, GitStatusFileStatus, GitUri, IGitCommitInfo, IGitStatusFile, RemoteResource } from '../gitService';
import { Keyboard, KeyNoopCommand, Keys } from '../keyboard';
import { OpenRemotesCommandQuickPickItem } from './remotes';
import * as moment from 'moment';
@ -20,7 +20,7 @@ export class CommitWithFileStatusQuickPickItem extends OpenFileCommandQuickPickI
status: GitStatusFileStatus;
constructor(commit: GitCommit, status: IGitStatusFile) {
const icon = getGitStatusIcon(status.status);
const octicon = getGitStatusOcticon(status.status);
const description = GitStatusFile.getFormattedDirectory(status, true);
let sha;
@ -35,7 +35,7 @@ export class CommitWithFileStatusQuickPickItem extends OpenFileCommandQuickPickI
}
super(GitService.toGitContentUri(sha, shortSha, status.fileName, commit.repoPath, status.originalFileName), {
label: `${Strings.pad(icon, 4, 2)} ${path.basename(status.fileName)}`,
label: `${Strings.pad(octicon, 4, 2)} ${path.basename(status.fileName)}`,
description: description
});

+ 2
- 2
src/quickPicks/repoStatus.ts Просмотреть файл

@ -11,11 +11,11 @@ import * as path from 'path';
export class OpenStatusFileCommandQuickPickItem extends OpenFileCommandQuickPickItem {
constructor(status: GitStatusFile, item?: QuickPickItem) {
const icon = status.getIcon();
const octicon = status.getOcticon();
const description = status.getFormattedDirectory(true);
super(status.Uri, item || {
label: `${status.staged ? '$(check)' : GlyphChars.Space.repeat(3)}${Strings.pad(icon, 2, 2)} ${path.basename(status.fileName)}`,
label: `${status.staged ? '$(check)' : GlyphChars.Space.repeat(3)}${Strings.pad(octicon, 2, 2)} ${path.basename(status.fileName)}`,
description: description
});
}

Загрузка…
Отмена
Сохранить