Преглед изворни кода

Adds customizable avatar size in hovers

Increases default avatar size in hovers from 16 to 32px
main
Eric Amodio пре 4 година
родитељ
комит
eba202bed3
4 измењених фајлова са 11 додато и 2 уклоњено
  1. +1
    -0
      README.md
  2. +6
    -0
      package.json
  3. +1
    -0
      src/config.ts
  4. +3
    -2
      src/git/formatters/commitFormatter.ts

+ 1
- 0
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<br /><br />`annotation` - only shown when hovering over the line annotation<br />`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<br /><br />`line` - Shows only the changes to the line<br /><br />`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 |

+ 6
- 0
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",

+ 1
- 0
src/config.ts Прегледај датотеку

@ -70,6 +70,7 @@ export interface Config {
over: 'line' | 'annotation';
};
avatars: boolean;
avatarSize: number;
changesDiff: 'line' | 'hunk';
detailsMarkdownFormat: string;
enabled: boolean;

+ 3
- 2
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) {

Loading…
Откажи
Сачувај