Skip to content

Avatar Improvements

Jan Blackquill requested to merge work/janb/avatar-improvements into master

This series of commits fixes issues and adds minor improvements I found needed while developing Murmur.

Commit One - Add primary/secondary action to Avatar

This is what it says on the tin.

Kirigami.Avatar {
    actions {
        main: Kirigami.Action {
            text: "yeet"
            iconName: "edit-delete"
        }
        secondary: Kirigami.Action {
            text: "yeet"
            iconName: "list-add"
        }
    }
}

The primary action will manifest as the avatar being clickable, while the secondary action will manifest as a desktop-only... thing? that appears when you hover over the avatar, mirroring the style of Telegram Desktop's secondary actions on its avatars.

Screenshot_20201108_222637

Commit Two - Adjust techniques used for circular shape

This simplifies the code substantially, and incidentally also reduces the jaggedness of the edges.

Before:

(notice the slight pink rim around the border)

Screenshot_20201108_223008

After:

(notice the pink rim is absent)

Screenshot_20201108_222910

Commit Three - Adjust sizing of text

This makes the text resize based off of the size of the avatar, as the the text is always either too big or too small otherwise.

Before:

Screenshot_20201108_223146

After:

Screenshot_20201108_223216

Commit Four - Make image mode set sourceSize

This trims down RAM usage per image (kinda important for Murmur given that I have a hard ceiling of 100MB usage in normal operation for it as a goal, and I can't be wasting it on 2MB apiece avatar images), and incidentally also makes the image crisper in some scenarios.

Commit Five - Increase padding of icon fallback

This makes the icon fallback of the Avatar slightly more padded, which IMO is an improvement to its appearance.

Before:

Screenshot_20201108_223436

After:

Screenshot_20201108_223355

Commit Six - Make avatar accessible

This too, is what it says on the tin.

Edited by Jan Blackquill

Merge request reports