Class Style

style properties

class Style;

Constructors

NameDescription
this (theme, id)

Fields

NameTypeDescription
_align ubyte
_alpha uint
_backgroundColor uint
_backgroundDrawable Ref!(dcanvas.graphics.resources.Drawable)
_backgroundImageId string
_border string
_boxShadow string
_children Style[]
_customColors uint[string]
_customDrawables DrawableAttributeList
_customLength uint[string]
_focusRectColors uint[]
_font Ref!(dcanvas.graphics.fonts.Font)
_fontFace string
_fontFamily FontFamily
_fontSize int
_fontStyle ubyte
_fontWeight ushort
_id string
_layoutHeight int
_layoutWeight int
_layoutWidth int
_margins Rect
_maxHeight int
_maxLines int
_maxWidth int
_minHeight int
_minWidth int
_padding Rect
_parentId string
_parentStyle Style
_stateMask uint
_stateValue uint
_substates Style[]
_textColor uint
_textFlags uint
_theme Theme

Properties

NameTypeDescription
alignment[get] ubyteget full alignment (both vertical and horizontal)
alignment[set] Styleset alignment
alpha[get] uintalpha (0=opaque .. 255=transparent)
alpha[set] Style
backgroundColor[get] uintbackground color
backgroundColor[set] Style
backgroundDrawable[get] Ref!(dcanvas.graphics.resources.Drawable)
backgroundImageId[get] stringbackground image id
backgroundImageId[set] Style
border[get] stringborder
border[set] Style
boxShadow[get] stringbox shadow
boxShadow[set] Style
focusRectColors[get] const(uint[])returns colors to draw focus rectangle (one for solid, two for vertical gradient) or null if no focus rect should be drawn for style
focusRectColors[set] Stylesets colors to draw focus rectangle or null if no focus rect should be drawn for style
font[get] Ref!(dcanvas.graphics.fonts.Font)
fontFace[get] stringfont size
fontFace[set] Style
fontFamily[get] FontFamilyfont size
fontFamily[set] Style
fontItalic[get] boolfont style - italic
fontSize[get] intfont size
fontSize[set] Style
fontStyle[set] Style
fontWeight[get] ushortfont weight
fontWeight[set] Style
halign[get] ubytehorizontal alignment: Left / HCenter / Right
id[get] string
id[set] Style
layoutHeight[get] uintlayout height parameter
layoutHeight[set] Styleset layout height
layoutWeight[get] uintlayout weight parameter
layoutWeight[set] Styleset layout weight
layoutWidth[get] uintlayout width parameter
layoutWidth[set] Styleset layout width
margins[get] const(Rect)margins
margins[set] Style
maxHeight[get] uintmax height constraint, SIZE_UNSPECIFIED if limit is not set
maxHeight[set] Styleset max height constraint
maxLines[get] inttext color
maxLines[set] Style
maxWidth[get] uintmax width constraint, returns SIZE_UNSPECIFIED if limit is not set
maxWidth[set] Styleset max width constraint
minHeight[get] uintminimal height constraint, 0 if limit is not set
minHeight[set] Styleset min height constraint
minWidth[get] uintminimal width constraint, 0 if limit is not set
minWidth[set] Styleset min width constraint
padding[get] const(Rect)padding
padding[set] Style
parentStyle[get] const(Style)access to parent style for this style
parentStyleId[get] string
parentStyleId[set] Style
textColor[get] uinttext color
textColor[set] Style
textFlags[get] uinttext flags
textFlags[set] Style
theme[get] const(Theme)
theme[get] Theme
valign[get] ubytevertical alignment: Top / VCenter / Bottom

Methods

NameDescription
clearCachedObjects ()
clone ()
createState (stateMask, stateValue) create state substyle for this style
createSubstyle (id) create named substyle of this style
customColor (id, defColor) get custom color attribute
customDrawable (id) get custom drawable attribute
customDrawableId (id) get custom drawable attribute
customLength (id, defLength) get custom length attribute
forState (state) find substyle based on widget state (e.g. focused, pressed, ...)
getOrCreateState (stateMask, stateValue) find exact existing state style or create new if no matched styles found
onThemeChanged ()
setCustomColor (id, color) sets custom color attribute for style
setCustomDrawable (id, resourceId) sets custom drawable attribute for style
setCustomLength (id, value) sets custom length attribute for style
setMargins (left, top, right, bottom)
setPadding (left, top, right, bottom)

Aliases

NameDescription
~this