Bug 434407 - Size inconsistency in initials-style avatar (default vs change avatar)
Summary: Size inconsistency in initials-style avatar (default vs change avatar)
Status: REPORTED
Alias: None
Product: frameworks-kirigami
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.80.0
Platform: Neon Linux
: NOR minor
Target Milestone: Not decided
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-14 17:42 UTC by Massimiliano L
Modified: 2021-04-19 09:38 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Avatar after re-setting it through dialog (8.58 KB, image/png)
2021-03-14 17:42 UTC, Massimiliano L
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Massimiliano L 2021-03-14 17:42:15 UTC
Created attachment 136674 [details]
Avatar after re-setting it through dialog

SUMMARY
The default initials-style avatar has a different size compared to the one that is obtained using the "Change Avatar" dialog. In particular, the latter is bigger and the letters overshoot the boundary of the circle (see attachment).


STEPS TO REPRODUCE
1. Fresh install KDE Neon
2. Change avatar and select one colour option among the initials-style
3. Apply

OBSERVED RESULT
The letters in the new avatar are bigger compared to the default, and overshoot the boundary of the circle. 

EXPECTED RESULT
It should be possible to obtain the default, properly-sized.

SIDE NOTE
From the Users configuration module there is no direct way to reset the avatar to the system default one, while other modules have a "Default" button to restore the system defaults.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.21.2
KDE Frameworks Version: 5.80.0
Qt Version: 5.15.2
Comment 1 Domenico Panella 2021-04-17 16:01:43 UTC
Decreasing "font.pixelSize" property 
at https://invent.kde.org/plasma/plasma-desktop/-/blob/master/kcms/users/package/contents/ui/UserDetailsPage.qml#L419

from
font.pixelSize: Kirigami.Units.gridUnit * 4

to
font.pixelSize: Kirigami.Units.gridUnit * 2.5

it looks good for me.
Comment 2 Massimiliano L 2021-04-17 16:40:12 UTC
(In reply to Domenico Panella from comment #1)
> Decreasing "font.pixelSize" property 
> at
> https://invent.kde.org/plasma/plasma-desktop/-/blob/master/kcms/users/
> package/contents/ui/UserDetailsPage.qml#L419
> 
> from
> font.pixelSize: Kirigami.Units.gridUnit * 4
> 
> to
> font.pixelSize: Kirigami.Units.gridUnit * 2.5
> 
> it looks good for me.

I understand you propose a change that makes the font smaller but do we understand why the font was changeing size compared to the default?
Comment 3 Domenico Panella 2021-04-18 16:39:36 UTC
(In reply to Massimiliano L from comment #2)
> (In reply to Domenico Panella from comment #1)
> > Decreasing "font.pixelSize" property 
> > at
> > https://invent.kde.org/plasma/plasma-desktop/-/blob/master/kcms/users/
> > package/contents/ui/UserDetailsPage.qml#L419
> > 
> > from
> > font.pixelSize: Kirigami.Units.gridUnit * 4
> > 
> > to
> > font.pixelSize: Kirigami.Units.gridUnit * 2.5
> > 
> > it looks good for me.
> 
> I understand you propose a change that makes the font smaller but do we
> understand why the font was changeing size compared to the default?

Yeah, the default image is an Item of the "Text" type not Image, whereas
when we select a new image with initial letters from dialog window,
we save it as Image (PNG).
This is the code which saves the image as PNG file
https://invent.kde.org/plasma/plasma-desktop/-/blob/master/kcms/users/package/contents/ui/UserDetailsPage.qml#L424-434

This is the code (kirigami side) which we decide to show Item text (default case) or image
https://invent.kde.org/frameworks/kirigami/-/blob/master/src/controls/Avatar.qml#L203-249

At the moment i see two potential problems:
1) The letters font is too large when we select the image from window dialog. (fixed it simply by decreasing it) 
2) If you attentively observe it, the new image is different than default how it's rendering too. This appears slightly blurry respect the default image.

In my opinion, the default image and the image which we select via window dialog should be handled at the same way. 
I mean both handled as Image or Text otherwise we will always see the difference between them.
Comment 4 Massimiliano L 2021-04-19 09:38:21 UTC
(In reply to Domenico Panella from comment #3)
> In my opinion, the default image and the image which we select via window
> dialog should be handled at the same way. 
> I mean both handled as Image or Text otherwise we will always see the
> difference between them.

I agree with your view. It is otherwise a bit strange to have a default configuration that can never be reset to default. Harmonising the two would be a good idea.