Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate avatars with author initials as fallback of gravatar #6499

Conversation

pmiossec
Copy link
Member

@pmiossec pmiossec commented Apr 22, 2019

A smaller step than #6417 as it requires no ("not everyone agrees") UI changes but bringing most of the added value...

Proposed changes

  • Add a new new gravatar fallback possibility with avatars generated from author initials

Screenshots

Before

image

image

After

image

image

Test methodology

  • Unit tests
  • Manual

Test environment(s)

  • Git Extensions 3.1.0
  • Build c937777
  • Git 2.20.1.windows.1
  • Microsoft Windows NT 10.0.17134.0
  • .NET Framework 4.7.3362.0
  • DPI 96dpi (no scaling)

✒️ I contribute this code under The Developer Certificate of Origin.

@codecov
Copy link

codecov bot commented Apr 22, 2019

Codecov Report

Merging #6499 into master will increase coverage by 0.02%.
The diff coverage is 73.2%.

@@            Coverage Diff             @@
##           master    #6499      +/-   ##
==========================================
+ Coverage   46.98%   47.01%   +0.02%     
==========================================
  Files         694      696       +2     
  Lines       52314    52393      +79     
  Branches     6874     6882       +8     
==========================================
+ Hits        24582    24631      +49     
- Misses      26409    26436      +27     
- Partials     1323     1326       +3
Flag Coverage Δ
#production 36.43% <46.05%> (+0.01%) ⬆️
#tests 97.56% <100%> (ø) ⬆️

private readonly Brush _textBrush = new SolidBrush(Color.WhiteSmoke);
private readonly Color[] _avatarColors =
{
Color.RoyalBlue,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for theming: May need customization. (I thought about asking for more colors too, but it should be OK).

Copy link
Member

@RussKie RussKie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍
Haven't had a chance to run it though


drawing.Save();

drawing.Dispose();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we instead write

using (var drawing = Graphics.FromImage(img))
{
    drawing.Clear(backColor);
    // ...
    drawing.Save();
}

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. I don't know why I haven't seen it.
Anyway... fixed.

@pmiossec pmiossec force-pushed the author_initials_avatar_as_gravatar_fallback branch from c937777 to 07ae765 Compare April 23, 2019 12:15
@RussKie
Copy link
Member

RussKie commented Apr 23, 2019

Works well 👍

@RussKie RussKie merged commit 8948dad into gitextensions:master Apr 23, 2019
@RussKie RussKie added this to the 3.1.0 milestone Apr 23, 2019
@pmiossec pmiossec deleted the author_initials_avatar_as_gravatar_fallback branch April 23, 2019 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants