FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    Members

    TYPE

    const TYPE: &'static $crate::TypeInfo
    

    The runtime type of this class.

    Source

    to_ref

    fn to_ref(self: &Self) -> $crate::Ref<PersonPicture>
    

    Returns a strong reference to this object.

    Source

    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+".

    Source

    badge_glyph_property

    fn badge_glyph_property() -> &'static StyledProperty<String>
    

    Defines the BadgeGlyph property: a glyph of the symbol font for the badge.

    Source

    badge_image_source_property

    fn badge_image_source_property() -> &'static StyledProperty<Option<Rc<dyn IImageBrushSource>>>
    

    Defines the BadgeImageSource property: an image for the badge.

    Source

    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").

    Source

    is_group_property

    fn is_group_property() -> &'static StyledProperty<bool>
    

    Defines the IsGroup property: whether the picture stands for a group.

    Source

    contact_property

    fn contact_property() -> &'static StyledProperty<Option<Ref<Contact>>>
    

    Defines the Contact property: the contact whose picture and initials are shown.

    Source

    display_name_property

    fn display_name_property() -> &'static StyledProperty<String>
    

    Defines the DisplayName property: the name the initials are made from.

    Source

    initials_property

    fn initials_property() -> &'static StyledProperty<String>
    

    Defines the Initials property: the initials, before those of the display name.

    Source

    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.

    Source

    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.

    Source

    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.

    Source

    construct

    fn construct() -> Self
    

    Creates the class data; see ferroui_base::FerroObject::construct.

    Source

    new

    fn new() -> Ref<Self>
    

    Creates a picture without a person.

    Source

    badge_number

    fn badge_number(self: &Self) -> i32
    

    Gets the number of the badge.

    Source

    set_badge_number

    fn set_badge_number(self: &Self, value: i32)
    

    Sets the number of the badge.

    Source

    badge_glyph

    fn badge_glyph(self: &Self) -> String
    

    Gets the glyph of the badge.

    Source

    set_badge_glyph

    fn set_badge_glyph(self: &Self, value: impl Into<String>)
    

    Sets the glyph of the badge.

    Source

    badge_image_source

    fn badge_image_source(self: &Self) -> Option<Rc<dyn IImageBrushSource>>
    

    Gets the image of the badge.

    Source

    set_badge_image_source

    fn set_badge_image_source(self: &Self, value: Option<Rc<dyn IImageBrushSource>>)
    

    Sets the image of the badge.

    Source

    badge_text

    fn badge_text(self: &Self) -> String
    

    Gets what the badge stands for in the automation name.

    Source

    set_badge_text

    fn set_badge_text(self: &Self, value: impl Into<String>)
    

    Sets what the badge stands for in the automation name.

    Source

    is_group

    fn is_group(self: &Self) -> bool
    

    Gets whether the picture stands for a group.

    Source

    set_is_group

    fn set_is_group(self: &Self, value: bool)
    

    Sets whether the picture stands for a group.

    Source

    contact

    fn contact(self: &Self) -> Option<Ref<Contact>>
    

    Gets the contact.

    Source

    set_contact

    fn set_contact(self: &Self, value: Option<Ref<Contact>>)
    

    Sets the contact.

    Source

    display_name

    fn display_name(self: &Self) -> String
    

    Gets the display name.

    Source

    set_display_name

    fn set_display_name(self: &Self, value: impl Into<String>)
    

    Sets the display name.

    Source

    initials

    fn initials(self: &Self) -> String
    

    Gets the initials.

    Source

    set_initials

    fn set_initials(self: &Self, value: impl Into<String>)
    

    Sets the initials.

    Source

    prefer_small_image

    fn prefer_small_image(self: &Self) -> bool
    

    Gets whether the small picture of the contact is shown before the large one.

    Source

    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.

    Source

    profile_picture

    fn profile_picture(self: &Self) -> Option<Rc<dyn IImageBrushSource>>
    

    Gets the profile picture.

    Source

    set_profile_picture

    fn set_profile_picture(self: &Self, value: Option<Rc<dyn IImageBrushSource>>)
    

    Sets the profile picture.

    Source

    template_settings

    fn template_settings(self: &Self) -> Ref<PersonPictureTemplateSettings>
    

    Gets the initials and the brush the template binds to.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.