gi-adwaita-1.0.1: Adwaita bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Adw.Objects.Avatar

Description

A widget displaying an image, with a generated fallback.

AdwAvatar is a widget that shows a round avatar.

AdwAvatar generates an avatar with the initials of the Avatar:text on top of a colored background.

The color is picked based on the hash of the Avatar:text.

If Avatar:showInitials is set to FALSE, Avatar:iconName or avatar-default-symbolic is shown instead of the initials.

Use Avatar:customImage to set a custom image.

CSS nodes

AdwAvatar has a single CSS node with name avatar.

Since: 1.0

Synopsis

Exported types

newtype Avatar Source #

Memory-managed wrapper type.

Constructors

Avatar (ManagedPtr Avatar) 

Instances

Instances details
Eq Avatar Source # 
Instance details

Defined in GI.Adw.Objects.Avatar

Methods

(==) :: Avatar -> Avatar -> Bool #

(/=) :: Avatar -> Avatar -> Bool #

GObject Avatar Source # 
Instance details

Defined in GI.Adw.Objects.Avatar

ManagedPtrNewtype Avatar Source # 
Instance details

Defined in GI.Adw.Objects.Avatar

TypedObject Avatar Source # 
Instance details

Defined in GI.Adw.Objects.Avatar

Methods

glibType :: IO GType #

HasParentTypes Avatar Source # 
Instance details

Defined in GI.Adw.Objects.Avatar

IsGValue (Maybe Avatar) Source #

Convert Avatar to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Adw.Objects.Avatar

type ParentTypes Avatar Source # 
Instance details

Defined in GI.Adw.Objects.Avatar

class (GObject o, IsDescendantOf Avatar o) => IsAvatar o Source #

Type class for types which can be safely cast to Avatar, for instance with toAvatar.

Instances

Instances details
(GObject o, IsDescendantOf Avatar o) => IsAvatar o Source # 
Instance details

Defined in GI.Adw.Objects.Avatar

toAvatar :: (MonadIO m, IsAvatar o) => o -> m Avatar Source #

Cast to Avatar, for types for which this is known to be safe. For general casts, use castTo.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, dragCheckThreshold, drawToTexture, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateProperty, updateRelation, updateState, watchClosure.

Getters

getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBuildableId, getCanFocus, getCanTarget, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getCustomImage, getData, getDirection, getDisplay, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getIconName, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getShowInitials, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getText, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

Setters

setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setCustomImage, setData, setDataFull, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setIconName, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setShowInitials, setSize, setSizeRequest, setStateFlags, setText, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.

drawToTexture

avatarDrawToTexture Source #

Arguments

:: (HasCallStack, MonadIO m, IsAvatar a) 
=> a

self: a AdwAvatar

-> Int32

scaleFactor: The scale factor

-> m Texture

Returns: the texture

Renders self into a Texture at scaleFactor.

This can be used to export the fallback avatar.

Since: 1.0

getCustomImage

avatarGetCustomImage Source #

Arguments

:: (HasCallStack, MonadIO m, IsAvatar a) 
=> a

self: a AdwAvatar

-> m (Maybe Paintable)

Returns: the custom image

Gets the custom image paintable.

Since: 1.0

getIconName

avatarGetIconName Source #

Arguments

:: (HasCallStack, MonadIO m, IsAvatar a) 
=> a

self: a AdwAvatar

-> m (Maybe Text)

Returns: the icon name

Gets the name of an icon to use as a fallback.

Since: 1.0

getShowInitials

avatarGetShowInitials Source #

Arguments

:: (HasCallStack, MonadIO m, IsAvatar a) 
=> a

self: a AdwAvatar

-> m Bool

Returns: whether initials are used instead of an icon as fallback

Gets whether initials are used instead of an icon on the fallback avatar.

Since: 1.0

getSize

avatarGetSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsAvatar a) 
=> a

self: a AdwAvatar

-> m Int32

Returns: the size of the avatar

Gets the size of the avatar.

Since: 1.0

getText

avatarGetText Source #

Arguments

:: (HasCallStack, MonadIO m, IsAvatar a) 
=> a

self: a AdwAvatar

-> m (Maybe Text)

Returns: the text used to generate the fallback initials and color

Gets the text used to generate the fallback initials and color.

Since: 1.0

new

avatarNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Int32

size: The size of the avatar

-> Maybe Text

text: the text used to get the initials and color

-> Bool

showInitials: whether to use initials instead of an icon as fallback

-> m Avatar

Returns: the newly created AdwAvatar

Creates a new AdwAvatar.

Since: 1.0

setCustomImage

avatarSetCustomImage Source #

Arguments

:: (HasCallStack, MonadIO m, IsAvatar a, IsPaintable b) 
=> a

self: a AdwAvatar

-> Maybe b

customImage: a custom image

-> m () 

Sets the custom image paintable.

Since: 1.0

setIconName

avatarSetIconName Source #

Arguments

:: (HasCallStack, MonadIO m, IsAvatar a) 
=> a

self: a AdwAvatar

-> Maybe Text

iconName: the icon name

-> m () 

Sets the name of an icon to use as a fallback.

If no name is set, avatar-default-symbolic will be used.

Since: 1.0

setShowInitials

avatarSetShowInitials Source #

Arguments

:: (HasCallStack, MonadIO m, IsAvatar a) 
=> a

self: a AdwAvatar

-> Bool

showInitials: whether to use initials instead of an icon as fallback

-> m () 

Sets whether to use initials instead of an icon on the fallback avatar.

Since: 1.0

setSize

avatarSetSize Source #

Arguments

:: (HasCallStack, MonadIO m, IsAvatar a) 
=> a

self: a AdwAvatar

-> Int32

size: The size of the avatar

-> m () 

Sets the size of the avatar.

Since: 1.0

setText

avatarSetText Source #

Arguments

:: (HasCallStack, MonadIO m, IsAvatar a) 
=> a

self: a AdwAvatar

-> Maybe Text

text: the text used to get the initials and color

-> m () 

Sets the text used to generate the fallback initials and color.

Since: 1.0

Properties

customImage

A custom image to use instead of initials or icon.

Since: 1.0

clearAvatarCustomImage :: (MonadIO m, IsAvatar o) => o -> m () Source #

Set the value of the “custom-image” property to Nothing. When overloading is enabled, this is equivalent to

clear #customImage

constructAvatarCustomImage :: (IsAvatar o, MonadIO m, IsPaintable a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “custom-image” property. This is rarely needed directly, but it is used by new.

getAvatarCustomImage :: (MonadIO m, IsAvatar o) => o -> m (Maybe Paintable) Source #

Get the value of the “custom-image” property. When overloading is enabled, this is equivalent to

get avatar #customImage

setAvatarCustomImage :: (MonadIO m, IsAvatar o, IsPaintable a) => o -> a -> m () Source #

Set the value of the “custom-image” property. When overloading is enabled, this is equivalent to

set avatar [ #customImage := value ]

iconName

The name of an icon to use as a fallback.

If no name is set, avatar-default-symbolic will be used.

Since: 1.0

clearAvatarIconName :: (MonadIO m, IsAvatar o) => o -> m () Source #

Set the value of the “icon-name” property to Nothing. When overloading is enabled, this is equivalent to

clear #iconName

constructAvatarIconName :: (IsAvatar o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “icon-name” property. This is rarely needed directly, but it is used by new.

getAvatarIconName :: (MonadIO m, IsAvatar o) => o -> m (Maybe Text) Source #

Get the value of the “icon-name” property. When overloading is enabled, this is equivalent to

get avatar #iconName

setAvatarIconName :: (MonadIO m, IsAvatar o) => o -> Text -> m () Source #

Set the value of the “icon-name” property. When overloading is enabled, this is equivalent to

set avatar [ #iconName := value ]

showInitials

Whether initials are used instead of an icon on the fallback avatar.

See Avatar:iconName for how to change the fallback icon.

Since: 1.0

constructAvatarShowInitials :: (IsAvatar o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “show-initials” property. This is rarely needed directly, but it is used by new.

getAvatarShowInitials :: (MonadIO m, IsAvatar o) => o -> m Bool Source #

Get the value of the “show-initials” property. When overloading is enabled, this is equivalent to

get avatar #showInitials

setAvatarShowInitials :: (MonadIO m, IsAvatar o) => o -> Bool -> m () Source #

Set the value of the “show-initials” property. When overloading is enabled, this is equivalent to

set avatar [ #showInitials := value ]

size

The size of the avatar.

Since: 1.0

constructAvatarSize :: (IsAvatar o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “size” property. This is rarely needed directly, but it is used by new.

getAvatarSize :: (MonadIO m, IsAvatar o) => o -> m Int32 Source #

Get the value of the “size” property. When overloading is enabled, this is equivalent to

get avatar #size

setAvatarSize :: (MonadIO m, IsAvatar o) => o -> Int32 -> m () Source #

Set the value of the “size” property. When overloading is enabled, this is equivalent to

set avatar [ #size := value ]

text

Sets the text used to generate the fallback initials and color.

It's only used to generate the color if Avatar:showInitials is FALSE.

Since: 1.0

clearAvatarText :: (MonadIO m, IsAvatar o) => o -> m () Source #

Set the value of the “text” property to Nothing. When overloading is enabled, this is equivalent to

clear #text

constructAvatarText :: (IsAvatar o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “text” property. This is rarely needed directly, but it is used by new.

getAvatarText :: (MonadIO m, IsAvatar o) => o -> m (Maybe Text) Source #

Get the value of the “text” property. When overloading is enabled, this is equivalent to

get avatar #text

setAvatarText :: (MonadIO m, IsAvatar o) => o -> Text -> m () Source #

Set the value of the “text” property. When overloading is enabled, this is equivalent to

set avatar [ #text := value ]