import QtQuick import Weave.Controls import Weave.Templates as T T.Avatar { id: root implicitWidth: Math.max(implicitContentWidth + leftPadding + rightPadding, implicitBackgroundWidth + leftInset + rightInset) implicitHeight: Math.max(implicitContentHeight + topPadding + bottomPadding, implicitBackgroundHeight + topInset + bottomInset) opacity: root.enabled ? 1.0 : Theme.semantic.opacity.disabled // TODO: Theme.component.avatar.opacity.disabled hoverEnabled: root.enabled initials: determineInitials(name, size) initialsColor: Theme.component.avatar.textColor placeholderColor: determinePlaceholderColor(name) contentItem: Item { implicitWidth: root._sizeAttributes.width implicitHeight: root._sizeAttributes.height CircularImage { id: avatarImage anchors.fill: parent source: root.source sourceSize.width: width sourceSize.height: height fillMode: Image.PreserveAspectCrop placeholderColor: root.placeholderColor placeholderText: root.size === T.Avatar.ExtraSmall && root.initials.length > 0 ? root.initials.charAt(0) : root.initials placeholderTextColor: root.initialsColor font.pixelSize: root._sizeAttributes.fontSize font.family: Theme.component.avatar.fontFamily font.weight: Theme.component.avatar.fontWeight } } background: Item { } }