From eba202bed35f0620f46febba5d823162342a2cf3 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 15 Jun 2020 01:12:33 -0400 Subject: [PATCH] Adds customizable avatar size in hovers Increases default avatar size in hovers from 16 to 32px --- README.md | 1 + package.json | 6 ++++++ src/config.ts | 1 + src/git/formatters/commitFormatter.ts | 5 +++-- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1f3074c..cc6df90 100644 --- a/README.md +++ b/README.md @@ -717,6 +717,7 @@ GitLens is highly customizable and provides many configuration settings to allow | `gitlens.hovers.annotations.enabled` | Specifies whether to provide any hovers when showing blame annotations | | `gitlens.hovers.annotations.over` | Specifies when to trigger hovers when showing blame annotations

`annotation` - only shown when hovering over the line annotation
`line` - shown when hovering anywhere over the line | | `gitlens.hovers.avatars` | Specifies whether to show avatar images in hovers | +| `gitlens.hovers.avatarSize` | Specifies the size of the avatar images in hovers | | `gitlens.hovers.changesDiff` | Specifies whether to show just the changes to the line or the set of related changes in the _changes (diff)_ hover

`line` - Shows only the changes to the line

`hunk` - Shows the set of related changes | | `gitlens.hovers.currentLine.changes` | Specifies whether to provide a _changes (diff)_ hover for the current line | | `gitlens.hovers.currentLine.details` | Specifies whether to provide a _commit details_ hover for the current line | diff --git a/package.json b/package.json index 0b07082..97a581b 100644 --- a/package.json +++ b/package.json @@ -687,6 +687,12 @@ "markdownDescription": "Specifies whether to show avatar images in hovers", "scope": "window" }, + "gitlens.hovers.avatarSize": { + "type": "number", + "default": 32, + "markdownDescription": "Specifies the size of the avatar images in hovers", + "scope": "window" + }, "gitlens.hovers.changesDiff": { "type": "string", "default": "line", diff --git a/src/config.ts b/src/config.ts index 28684d3..9e8c591 100644 --- a/src/config.ts +++ b/src/config.ts @@ -70,6 +70,7 @@ export interface Config { over: 'line' | 'annotation'; }; avatars: boolean; + avatarSize: number; changesDiff: 'line' | 'hunk'; detailsMarkdownFormat: string; enabled: boolean; diff --git a/src/git/formatters/commitFormatter.ts b/src/git/formatters/commitFormatter.ts index 54fc0d8..d2e0f78 100644 --- a/src/git/formatters/commitFormatter.ts +++ b/src/git/formatters/commitFormatter.ts @@ -175,9 +175,10 @@ export class CommitFormatter extends Formatter { } private _getAvatarMarkdown(title: string) { + const size = Container.config.hovers.avatarSize; return `![${title}](${this._item - .getAvatarUri(Container.config.defaultGravatarsStyle) - .toString(true)}|width=16,height=16 "${title}")`; + .getAvatarUri(Container.config.defaultGravatarsStyle, size) + .toString(true)}|width=${size},height=${size} "${title}")`; } private _getPresenceMarkdown(presence: ContactPresence, title: string) {