PersonPicture
struct · ferroui-controls · v0.5.0
struct PersonPicture
A picture of a person or a group (WinUI's PersonPicture): the profile picture, else the
initials of the display name or of the contact, else the glyph of a contact, in a circle,
with a badge (a number, a glyph or an image) at its top right.
The template is the control theme of the WinUI theme (Controls/PersonPicture.xaml, from
WinUI's PersonPicture.xaml), with WinUI's parts InitialsTextBlock, BadgeNumberTextBlock,
BadgeGlyphIcon, BadgingEllipse and BadgingBackgroundEllipse. The control sets WinUI's
visual states as pseudo-classes: :photo, :nophotoorinitials and :group (CommonStates;
Initials sets none), :badge and :badgeimage (BadgeStates). It keeps itself a circle: a
change of its size sets its width and height to the smaller of them, as WinUI's does. The
Fluent and Simple themes have no template for it (docs/porting/winui-controls.md, section 5.1).
Differences (docs/porting/winui-controls.md, section 10.10): the contact is FerroUI's
Contact, whose pictures are images, so the picture of a contact is shown at once (WinUI
opens and decodes a stream reference asynchronously, at the size of the control); the
pictures are image brush sources (a bitmap), the type of the image brush that paints them.
Members
TYPEto_refbadge_number_propertybadge_glyph_propertybadge_image_source_propertybadge_text_propertyis_group_propertycontact_propertydisplay_name_propertyinitials_propertyprefer_small_image_propertyprofile_picture_propertytemplate_settings_propertyconstructnewbadge_numberset_badge_numberbadge_glyphset_badge_glyphbadge_image_sourceset_badge_image_sourcebadge_textset_badge_textis_groupset_is_groupcontactset_contactdisplay_nameset_display_nameinitialsset_initialsprefer_small_imageset_prefer_small_imageprofile_pictureset_profile_picturetemplate_settings
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<PersonPicture>
Returns a strong reference to this object.
badge_number_property
fn badge_number_property() -> &'static StyledProperty<i32>
Defines the BadgeNumber property: the number of the badge, none at 0 (the default);
more than 99 shows "99+".
badge_glyph_property
fn badge_glyph_property() -> &'static StyledProperty<String>
Defines the BadgeGlyph property: a glyph of the symbol font for the badge.
badge_image_source_property
fn badge_image_source_property() -> &'static StyledProperty<Option<Rc<dyn IImageBrushSource>>>
Defines the BadgeImageSource property: an image for the badge.
badge_text_property
fn badge_text_property() -> &'static StyledProperty<String>
Defines the BadgeText property: what the badge stands for in the automation name
("5 messages" instead of "5 items").
is_group_property
fn is_group_property() -> &'static StyledProperty<bool>
Defines the IsGroup property: whether the picture stands for a group.
contact_property
fn contact_property() -> &'static StyledProperty<Option<Ref<Contact>>>
Defines the Contact property: the contact whose picture and initials are shown.
display_name_property
fn display_name_property() -> &'static StyledProperty<String>
Defines the DisplayName property: the name the initials are made from.
initials_property
fn initials_property() -> &'static StyledProperty<String>
Defines the Initials property: the initials, before those of the display name.
prefer_small_image_property
fn prefer_small_image_property() -> &'static StyledProperty<bool>
Defines the PreferSmallImage property: whether the small picture of the contact is
shown before the large one.
profile_picture_property
fn profile_picture_property() -> &'static StyledProperty<Option<Rc<dyn IImageBrushSource>>>
Defines the ProfilePicture property: the picture, before the one of the contact.
template_settings_property
fn template_settings_property() -> &'static StyledProperty<Option<Ref<PersonPictureTemplateSettings>>>
Defines the TemplateSettings property: the initials and the brush the template binds to.
construct
fn construct() -> Self
Creates the class data; see ferroui_base::FerroObject::construct.
new
fn new() -> Ref<Self>
Creates a picture without a person.
badge_number
fn badge_number(self: &Self) -> i32
Gets the number of the badge.
set_badge_number
fn set_badge_number(self: &Self, value: i32)
Sets the number of the badge.
badge_glyph
fn badge_glyph(self: &Self) -> String
Gets the glyph of the badge.
set_badge_glyph
fn set_badge_glyph(self: &Self, value: impl Into<String>)
Sets the glyph of the badge.
badge_image_source
fn badge_image_source(self: &Self) -> Option<Rc<dyn IImageBrushSource>>
Gets the image of the badge.
set_badge_image_source
fn set_badge_image_source(self: &Self, value: Option<Rc<dyn IImageBrushSource>>)
Sets the image of the badge.
badge_text
fn badge_text(self: &Self) -> String
Gets what the badge stands for in the automation name.
set_badge_text
fn set_badge_text(self: &Self, value: impl Into<String>)
Sets what the badge stands for in the automation name.
is_group
fn is_group(self: &Self) -> bool
Gets whether the picture stands for a group.
set_is_group
fn set_is_group(self: &Self, value: bool)
Sets whether the picture stands for a group.
contact
fn contact(self: &Self) -> Option<Ref<Contact>>
Gets the contact.
set_contact
fn set_contact(self: &Self, value: Option<Ref<Contact>>)
Sets the contact.
display_name
fn display_name(self: &Self) -> String
Gets the display name.
set_display_name
fn set_display_name(self: &Self, value: impl Into<String>)
Sets the display name.
initials
fn initials(self: &Self) -> String
Gets the initials.
set_initials
fn set_initials(self: &Self, value: impl Into<String>)
Sets the initials.
prefer_small_image
fn prefer_small_image(self: &Self) -> bool
Gets whether the small picture of the contact is shown before the large one.
set_prefer_small_image
fn set_prefer_small_image(self: &Self, value: bool)
Sets whether the small picture of the contact is shown before the large one.
profile_picture
fn profile_picture(self: &Self) -> Option<Rc<dyn IImageBrushSource>>
Gets the profile picture.
set_profile_picture
fn set_profile_picture(self: &Self, value: Option<Rc<dyn IImageBrushSource>>)
Sets the profile picture.
template_settings
fn template_settings(self: &Self) -> Ref<PersonPictureTemplateSettings>
Gets the initials and the brush the template binds to.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeTemplatedControlImplExtControlImplExtBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyInputElementImplExtInteractiveImplExtLayoutableImplExtFerroObjectImplExtStyledElementImplExtClassDefaultsVisualImplExtErasedDestructorIntoEitherDerefUpcast<T>Upcast<PersonPicture>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleStyledElementImplVisualImplLayoutableImplInteractiveImplInputElementImplFerroObjectImplControlImplTemplatedControlImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.