Class Theme

Theme - root for style hierarhy.

Inherits from


Name Description


Name Type Description
unknownStyleIds int[string] to track unknown styles refernced from code
_byId Style[string]
_align ubyte
_alpha uint
_backgroundColor uint
_backgroundDrawable Ref!(
_backgroundImageId string
_children Style[]
_customColors uint[string]
_customDrawables DrawableAttribute[string]
_customLength uint[string]
_focusRectColors uint[]
_font Ref!(
_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


Name Type Description
backgroundImageId [get] string font size
focusRectColors [get] const(uint[]) returns colors to draw focus rectangle or null if no focus rect should be drawn for style
get [set] Style find style by id, returns theme if not style with specified ID is not found
maxHeight [get] uint max height constraint, SIZE_UNSPECIFIED if limit is not set
maxWidth [get] uint max width constraint, returns SIZE_UNSPECIFIED if limit is not set
minHeight [get] uint minimal height constraint, 0 if limit is not set
minWidth [get] uint minimal width constraint, 0 if limit is not set
alignment [get] ubyte get full alignment (both vertical and horizontal)
alignment [set] Style set alignment
alpha [get] uint alpha (0=opaque .. 255=transparent)
alpha [set] Style
backgroundColor [set] Style
backgroundColor [get] uint background color
backgroundDrawable [get] Ref!(
backgroundImageId [set] Style
focusRectColors [set] Style sets colors to draw focus rectangle or null if no focus rect should be drawn for style
font [get] Ref!(
fontFace [get] string font size
fontFace [set] Style
fontFamily [set] Style
fontFamily [get] FontFamily font size
fontItalic [get] bool font style - italic
fontSize [set] Style
fontSize [get] int font size
fontStyle [set] Style
fontWeight [set] Style
fontWeight [get] ushort font weight
halign [get] ubyte horizontal alignment: Left / HCenter / Right
id [set] Style
id [get] string
layoutHeight [set] Style set layout height
layoutHeight [get] uint layout height parameter
layoutWeight [set] Style set layout weight
layoutWeight [get] uint layout weight parameter
layoutWidth [set] Style set layout width
layoutWidth [get] uint layout width parameter
margins [get] const(Rect) margins
margins [set] Style
maxHeight [set] Style set max height constraint
maxLines [set] Style
maxLines [get] int text color
maxWidth [set] Style set max width constraint
minHeight [set] Style set min height constraint
minWidth [set] Style set 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 [set] Style
textColor [get] uint text color
textFlags [get] uint text flags
textFlags [set] Style
theme [get] Theme
theme [get] const(Theme)
valign [get] ubyte vertical alignment: Top / VCenter / Bottom


Name Description
createSubstyle create new named style or get existing
customColor get custom color attribute - transparent by default
customDrawableId get custom drawable attribute
customLength get custom color attribute - transparent by default
forState find substyle based on widget state (e.g. focused, pressed, ...)
modifyStyle create wrapper style which will have currentTheme.get(id) as parent instead of fixed parent - to modify some base style properties in widget
createState create state substyle for this style
customDrawable get custom drawable attribute
getOrCreateState find exact existing state style or create new if no matched styles found
setCustomColor sets custom color attribute for style
setCustomDrawable sets custom drawable attribute for style
setCustomLength sets custom length attribute for style


Vadim Lopatin,


Vadim Lopatin, 2014


Boost License 1.0