Bläddra i källkod

Adds menu toggle to control view avatars

main
Eric Amodio 4 år sedan
förälder
incheckning
e2e212609b
6 ändrade filer med 230 tillägg och 17 borttagningar
  1. +146
    -8
      package.json
  2. +16
    -3
      src/views/compareView.ts
  3. +16
    -1
      src/views/fileHistoryView.ts
  4. +16
    -1
      src/views/lineHistoryView.ts
  5. +20
    -3
      src/views/repositoriesView.ts
  6. +16
    -1
      src/views/searchView.ts

+ 146
- 8
package.json Visa fil

@ -3060,6 +3060,16 @@
"category": "GitLens"
},
{
"command": "gitlens.views.repositories.setShowAvatarsOn",
"title": "Show Avatars",
"category": "GitLens"
},
{
"command": "gitlens.views.repositories.setShowAvatarsOff",
"title": "Hide Avatars",
"category": "GitLens"
},
{
"command": "gitlens.views.fileHistory.refresh",
"title": "Refresh",
"category": "GitLens",
@ -3094,6 +3104,16 @@
"category": "GitLens"
},
{
"command": "gitlens.views.fileHistory.setShowAvatarsOn",
"title": "Show Avatars",
"category": "GitLens"
},
{
"command": "gitlens.views.fileHistory.setShowAvatarsOff",
"title": "Hide Avatars",
"category": "GitLens"
},
{
"command": "gitlens.views.lineHistory.refresh",
"title": "Refresh",
"category": "GitLens",
@ -3128,6 +3148,16 @@
"category": "GitLens"
},
{
"command": "gitlens.views.lineHistory.setShowAvatarsOn",
"title": "Show Avatars",
"category": "GitLens"
},
{
"command": "gitlens.views.lineHistory.setShowAvatarsOff",
"title": "Hide Avatars",
"category": "GitLens"
},
{
"command": "gitlens.views.compare.selectForCompare",
"title": "Compare References...",
"category": "GitLens",
@ -3179,6 +3209,16 @@
"icon": "$(lock)"
},
{
"command": "gitlens.views.compare.setShowAvatarsOn",
"title": "Show Avatars",
"category": "GitLens"
},
{
"command": "gitlens.views.compare.setShowAvatarsOff",
"title": "Hide Avatars",
"category": "GitLens"
},
{
"command": "gitlens.views.compare.pinComparison",
"title": "Pin Comparison",
"category": "GitLens",
@ -3254,6 +3294,16 @@
"icon": "$(lock)"
},
{
"command": "gitlens.views.search.setShowAvatarsOn",
"title": "Show Avatars",
"category": "GitLens"
},
{
"command": "gitlens.views.search.setShowAvatarsOff",
"title": "Hide Avatars",
"category": "GitLens"
},
{
"command": "gitlens.views.dismissNode",
"title": "Dismiss",
"category": "GitLens",
@ -3924,6 +3974,14 @@
"when": "false"
},
{
"command": "gitlens.views.repositories.setShowAvatarsOn",
"when": "false"
},
{
"command": "gitlens.views.repositories.setShowAvatarsOff",
"when": "false"
},
{
"command": "gitlens.views.fileHistory.refresh",
"when": "false"
},
@ -3948,6 +4006,14 @@
"when": "false"
},
{
"command": "gitlens.views.fileHistory.setShowAvatarsOn",
"when": "false"
},
{
"command": "gitlens.views.fileHistory.setShowAvatarsOff",
"when": "false"
},
{
"command": "gitlens.views.lineHistory.refresh",
"when": "false"
},
@ -3972,6 +4038,14 @@
"when": "false"
},
{
"command": "gitlens.views.lineHistory.setShowAvatarsOn",
"when": "false"
},
{
"command": "gitlens.views.lineHistory.setShowAvatarsOff",
"when": "false"
},
{
"command": "gitlens.views.compare.selectForCompare",
"when": "gitlens:enabled && config.gitlens.views.compare.enabled"
},
@ -4004,6 +4078,14 @@
"when": "false"
},
{
"command": "gitlens.views.compare.setShowAvatarsOn",
"when": "false"
},
{
"command": "gitlens.views.compare.setShowAvatarsOff",
"when": "false"
},
{
"command": "gitlens.views.compare.pinComparison",
"when": "false"
},
@ -4044,6 +4126,14 @@
"when": "false"
},
{
"command": "gitlens.views.search.setShowAvatarsOn",
"when": "false"
},
{
"command": "gitlens.views.search.setShowAvatarsOff",
"when": "false"
},
{
"command": "gitlens.views.dismissNode",
"when": "false"
},
@ -4412,14 +4502,24 @@
"group": "navigation@99"
},
{
"command": "gitlens.views.repositories.setShowAvatarsOn",
"when": "view =~ /^gitlens\\.views\\.repositories:/ && !config.gitlens.views.repositories.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.repositories.setShowAvatarsOff",
"when": "view =~ /^gitlens\\.views\\.repositories:/ && config.gitlens.views.repositories.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.repositories.setAutoRefreshToOn",
"when": "view =~ /^gitlens\\.views\\.repositories:/ && config.gitlens.views.repositories.autoRefresh && !gitlens:views:repositories:autoRefresh",
"group": "2_gitlens"
"group": "2_gitlens@0"
},
{
"command": "gitlens.views.repositories.setAutoRefreshToOff",
"when": "view =~ /^gitlens\\.views\\.repositories:/ && config.gitlens.views.repositories.autoRefresh && gitlens:views:repositories:autoRefresh",
"group": "2_gitlens"
"group": "2_gitlens@0"
},
{
"command": "gitlens.views.fileHistory.setEditorFollowingOn",
@ -4442,14 +4542,22 @@
"group": "navigation@99"
},
{
"command": "gitlens.views.fileHistory.setShowAvatarsOn",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/ && !config.gitlens.views.fileHistory.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.fileHistory.setShowAvatarsOff",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/ && config.gitlens.views.fileHistory.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.fileHistory.setRenameFollowingOn",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/ && !config.gitlens.advanced.fileHistoryFollowsRenames",
"group": "1_gitlens"
"group": "2_gitlens@0"
},
{
"command": "gitlens.views.fileHistory.setRenameFollowingOff",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/ && config.gitlens.advanced.fileHistoryFollowsRenames",
"group": "1_gitlens"
"group": "2_gitlens@0"
},
{
"command": "gitlens.views.lineHistory.setEditorFollowingOn",
@ -4472,14 +4580,24 @@
"group": "navigation@99"
},
{
"command": "gitlens.views.lineHistory.setShowAvatarsOn",
"when": "view =~ /^gitlens\\.views\\.lineHistory:/ && !config.gitlens.views.lineHistory.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.lineHistory.setShowAvatarsOff",
"when": "view =~ /^gitlens\\.views\\.lineHistory:/ && config.gitlens.views.lineHistory.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.lineHistory.setRenameFollowingOn",
"when": "view =~ /^gitlens\\.views\\.lineHistory:/ && !config.gitlens.advanced.fileHistoryFollowsRenames",
"group": "1_gitlens"
"group": "2_gitlens@0"
},
{
"command": "gitlens.views.lineHistory.setRenameFollowingOff",
"when": "view =~ /^gitlens\\.views\\.lineHistory:/ && config.gitlens.advanced.fileHistoryFollowsRenames",
"group": "1_gitlens"
"group": "2_gitlens@0"
},
{
"command": "gitlens.views.compare.selectForCompare",
@ -4522,6 +4640,16 @@
"group": "navigation@99"
},
{
"command": "gitlens.views.compare.setShowAvatarsOn",
"when": "view =~ /^gitlens\\.views\\.compare:/ && !config.gitlens.views.compare.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.compare.setShowAvatarsOff",
"when": "view =~ /^gitlens\\.views\\.compare:/ && config.gitlens.views.compare.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.search.searchCommits",
"when": "view =~ /^gitlens\\.views\\.search:/",
"group": "navigation@10"
@ -4562,6 +4690,16 @@
"group": "navigation@99"
},
{
"command": "gitlens.views.search.setShowAvatarsOn",
"when": "view =~ /^gitlens\\.views\\.search:/ && !config.gitlens.views.search.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.search.setShowAvatarsOff",
"when": "view =~ /^gitlens\\.views\\.search:/ && config.gitlens.views.search.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.supportGitLens",
"when": "view =~ /^gitlens\\.views\\..*:/ && config.gitlens.advanced.messages.suppressSupportGitLensNotification != true && gitlens:views:supportGitLens:hide != true",
"group": "navigation@1"

+ 16
- 3
src/views/compareView.ts Visa fil

@ -59,18 +59,27 @@ export class CompareView extends ViewBase {
() => this.setKeepResults(false),
this,
);
commands.registerCommand(this.getQualifiedCommand('setShowAvatarsOn'), () => this.setShowAvatars(true), this);
commands.registerCommand(this.getQualifiedCommand('setShowAvatarsOff'), () => this.setShowAvatars(false), this);
commands.registerCommand(this.getQualifiedCommand('pinComparison'), this.pinComparison, this);
commands.registerCommand(this.getQualifiedCommand('unpinComparison'), this.unpinComparison, this);
commands.registerCommand(this.getQualifiedCommand('swapComparison'), this.swapComparison, this);
commands.registerCommand(this.getQualifiedCommand('selectForCompare'), this.selectForCompare, this);
commands.registerCommand(this.getQualifiedCommand('compareWithSelected'), this.compareWithSelected, this);
}
protected onConfigurationChanged(e: ConfigurationChangeEvent) {
if (
!configuration.changed(e, 'views') &&
!configuration.changed(e, 'views', 'compare') &&
!configuration.changed(e, 'views', 'commitFileDescriptionFormat') &&
!configuration.changed(e, 'views', 'commitFileFormat') &&
!configuration.changed(e, 'views', 'commitDescriptionFormat') &&
!configuration.changed(e, 'views', 'commitFormat') &&
!configuration.changed(e, 'views', 'defaultItemLimit') &&
!configuration.changed(e, 'views', 'pageItemLimit') &&
!configuration.changed(e, 'views', 'showRelativeDateMarkers') &&
!configuration.changed(e, 'views', 'statusFileDescriptionFormat') &&
!configuration.changed(e, 'views', 'statusFileFormat') &&
!configuration.changed(e, 'defaultDateFormat') &&
!configuration.changed(e, 'defaultDateSource') &&
!configuration.changed(e, 'defaultDateStyle') &&
@ -174,6 +183,10 @@ export class CompareView extends ViewBase {
setCommandContext(CommandContext.ViewsCompareKeepResults, enabled);
}
private setShowAvatars(enabled: boolean) {
return configuration.updateEffective('views', 'compare', 'avatars', enabled);
}
private pinComparison(node: ViewNode) {
if (!(node instanceof CompareResultsNode)) return undefined;

+ 16
- 1
src/views/fileHistoryView.ts Visa fil

@ -50,11 +50,22 @@ export class FileHistoryView extends ViewBase {
() => this.setRenameFollowing(false),
this,
);
commands.registerCommand(this.getQualifiedCommand('setShowAvatarsOn'), () => this.setShowAvatars(true), this);
commands.registerCommand(this.getQualifiedCommand('setShowAvatarsOff'), () => this.setShowAvatars(false), this);
}
protected onConfigurationChanged(e: ConfigurationChangeEvent) {
if (
!configuration.changed(e, 'views') &&
!configuration.changed(e, 'views', 'fileHistory') &&
!configuration.changed(e, 'views', 'commitFileDescriptionFormat') &&
!configuration.changed(e, 'views', 'commitFileFormat') &&
!configuration.changed(e, 'views', 'commitDescriptionFormat') &&
!configuration.changed(e, 'views', 'commitFormat') &&
!configuration.changed(e, 'views', 'defaultItemLimit') &&
!configuration.changed(e, 'views', 'pageItemLimit') &&
!configuration.changed(e, 'views', 'showRelativeDateMarkers') &&
!configuration.changed(e, 'views', 'statusFileDescriptionFormat') &&
!configuration.changed(e, 'views', 'statusFileFormat') &&
!configuration.changed(e, 'defaultDateFormat') &&
!configuration.changed(e, 'defaultDateSource') &&
!configuration.changed(e, 'defaultDateStyle') &&
@ -105,4 +116,8 @@ export class FileHistoryView extends ViewBase {
private setRenameFollowing(enabled: boolean) {
return configuration.updateEffective('advanced', 'fileHistoryFollowsRenames', enabled);
}
private setShowAvatars(enabled: boolean) {
return configuration.updateEffective('views', 'fileHistory', 'avatars', enabled);
}
}

+ 16
- 1
src/views/lineHistoryView.ts Visa fil

@ -49,11 +49,22 @@ export class LineHistoryView extends ViewBase {
() => this.setRenameFollowing(false),
this,
);
commands.registerCommand(this.getQualifiedCommand('setShowAvatarsOn'), () => this.setShowAvatars(true), this);
commands.registerCommand(this.getQualifiedCommand('setShowAvatarsOff'), () => this.setShowAvatars(false), this);
}
protected onConfigurationChanged(e: ConfigurationChangeEvent) {
if (
!configuration.changed(e, 'views') &&
!configuration.changed(e, 'views', 'lineHistory') &&
!configuration.changed(e, 'views', 'commitFileDescriptionFormat') &&
!configuration.changed(e, 'views', 'commitFileFormat') &&
!configuration.changed(e, 'views', 'commitDescriptionFormat') &&
!configuration.changed(e, 'views', 'commitFormat') &&
!configuration.changed(e, 'views', 'defaultItemLimit') &&
!configuration.changed(e, 'views', 'pageItemLimit') &&
!configuration.changed(e, 'views', 'showRelativeDateMarkers') &&
!configuration.changed(e, 'views', 'statusFileDescriptionFormat') &&
!configuration.changed(e, 'views', 'statusFileFormat') &&
!configuration.changed(e, 'defaultDateFormat') &&
!configuration.changed(e, 'defaultDateSource') &&
!configuration.changed(e, 'defaultDateStyle') &&
@ -96,4 +107,8 @@ export class LineHistoryView extends ViewBase {
private setRenameFollowing(enabled: boolean) {
return configuration.updateEffective('advanced', 'fileHistoryFollowsRenames', enabled);
}
private setShowAvatars(enabled: boolean) {
return configuration.updateEffective('views', 'lineHistory', 'avatars', enabled);
}
}

+ 20
- 3
src/views/repositoriesView.ts Visa fil

@ -88,7 +88,6 @@ export class RepositoriesView extends ViewBase {
() => this.setFilesLayout(ViewFilesLayout.Tree),
this,
);
commands.registerCommand(
this.getQualifiedCommand('setAutoRefreshToOn'),
() => this.setAutoRefresh(Container.config.views.repositories.autoRefresh, true),
@ -99,7 +98,8 @@ export class RepositoriesView extends ViewBase {
() => this.setAutoRefresh(Container.config.views.repositories.autoRefresh, false),
this,
);
commands.registerCommand(this.getQualifiedCommand('setShowAvatarsOn'), () => this.setShowAvatars(true), this);
commands.registerCommand(this.getQualifiedCommand('setShowAvatarsOff'), () => this.setShowAvatars(false), this);
commands.registerCommand(
this.getQualifiedCommand('setBranchComparisonToWorking'),
n => this.setBranchComparison(n, ViewShowBranchComparison.Working),
@ -114,7 +114,20 @@ export class RepositoriesView extends ViewBase {
protected onConfigurationChanged(e: ConfigurationChangeEvent) {
if (
!configuration.changed(e, 'views') &&
!configuration.changed(e, 'views', 'repositories') &&
!configuration.changed(e, 'views', 'commitFileDescriptionFormat') &&
!configuration.changed(e, 'views', 'commitFileFormat') &&
!configuration.changed(e, 'views', 'commitDescriptionFormat') &&
!configuration.changed(e, 'views', 'commitFormat') &&
!configuration.changed(e, 'views', 'defaultItemLimit') &&
!configuration.changed(e, 'views', 'pageItemLimit') &&
!configuration.changed(e, 'views', 'showRelativeDateMarkers') &&
!configuration.changed(e, 'views', 'stashFileDescriptionFormat') &&
!configuration.changed(e, 'views', 'stashFileFormat') &&
!configuration.changed(e, 'views', 'stashDescriptionFormat') &&
!configuration.changed(e, 'views', 'stashFormat') &&
!configuration.changed(e, 'views', 'statusFileDescriptionFormat') &&
!configuration.changed(e, 'views', 'statusFileFormat') &&
!configuration.changed(e, 'defaultDateFormat') &&
!configuration.changed(e, 'defaultDateSource') &&
!configuration.changed(e, 'defaultDateStyle') &&
@ -560,4 +573,8 @@ export class RepositoriesView extends ViewBase {
private setFilesLayout(layout: ViewFilesLayout) {
return configuration.updateEffective('views', 'repositories', 'files', 'layout', layout);
}
private setShowAvatars(enabled: boolean) {
return configuration.updateEffective('views', 'repositories', 'avatars', enabled);
}
}

+ 16
- 1
src/views/searchView.ts Visa fil

@ -61,11 +61,22 @@ export class SearchView extends ViewBase {
() => this.setKeepResults(false),
this,
);
commands.registerCommand(this.getQualifiedCommand('setShowAvatarsOn'), () => this.setShowAvatars(true), this);
commands.registerCommand(this.getQualifiedCommand('setShowAvatarsOff'), () => this.setShowAvatars(false), this);
}
protected onConfigurationChanged(e: ConfigurationChangeEvent) {
if (
!configuration.changed(e, 'views') &&
!configuration.changed(e, 'views', 'search') &&
!configuration.changed(e, 'views', 'commitFileDescriptionFormat') &&
!configuration.changed(e, 'views', 'commitFileFormat') &&
!configuration.changed(e, 'views', 'commitDescriptionFormat') &&
!configuration.changed(e, 'views', 'commitFormat') &&
!configuration.changed(e, 'views', 'defaultItemLimit') &&
!configuration.changed(e, 'views', 'pageItemLimit') &&
!configuration.changed(e, 'views', 'showRelativeDateMarkers') &&
!configuration.changed(e, 'views', 'statusFileDescriptionFormat') &&
!configuration.changed(e, 'views', 'statusFileFormat') &&
!configuration.changed(e, 'defaultDateFormat') &&
!configuration.changed(e, 'defaultDateSource') &&
!configuration.changed(e, 'defaultDateStyle') &&
@ -261,4 +272,8 @@ export class SearchView extends ViewBase {
Container.context.workspaceState.update(WorkspaceState.ViewsSearchKeepResults, enabled);
setCommandContext(CommandContext.ViewsSearchKeepResults, enabled);
}
private setShowAvatars(enabled: boolean) {
return configuration.updateEffective('views', 'search', 'avatars', enabled);
}
}

Laddar…
Avbryt
Spara