Class Theme
Theme - root for style hierarhy.
Constructors
| Name | Description |
|---|---|
this
(id)
|
Fields
| Name | Type | Description |
|---|---|---|
unknownStyleIds
|
int[string] | to track unknown styles refernced from code |
_byId
|
Style[string] | |
_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
| Name | Type | Description |
|---|---|---|
backgroundImageId[get]
|
string | font size |
border[get]
|
string | border |
boxShadow[get]
|
string | box shadow |
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[get]
|
uint | background color |
backgroundColor[set]
|
Style | |
backgroundDrawable[get]
|
Ref!(dcanvas.graphics.resources.Drawable) | |
backgroundImageId[set]
|
Style | |
border[set]
|
Style | |
boxShadow[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!(dcanvas.graphics.fonts.Font) | |
fontFace[get]
|
string | font size |
fontFace[set]
|
Style | |
fontFamily[get]
|
FontFamily | font size |
fontFamily[set]
|
Style | |
fontItalic[get]
|
bool | font style - italic |
fontSize[get]
|
int | font size |
fontSize[set]
|
Style | |
fontStyle[set]
|
Style | |
fontWeight[get]
|
ushort | font weight |
fontWeight[set]
|
Style | |
halign[get]
|
ubyte | horizontal alignment: Left / HCenter / Right |
id[get]
|
string | |
id[set]
|
Style | |
layoutHeight[get]
|
uint | layout height parameter |
layoutHeight[set]
|
Style | set layout height |
layoutWeight[get]
|
uint | layout weight parameter |
layoutWeight[set]
|
Style | set layout weight |
layoutWidth[get]
|
uint | layout width parameter |
layoutWidth[set]
|
Style | set layout width |
margins[get]
|
const(Rect) | margins |
margins[set]
|
Style | |
maxHeight[set]
|
Style | set max height constraint |
maxLines[get]
|
int | text color |
maxLines[set]
|
Style | |
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[get]
|
uint | text color |
textColor[set]
|
Style | |
textFlags[get]
|
uint | text flags |
textFlags[set]
|
Style | |
theme[get]
|
const(Theme) | |
theme[get]
|
Theme | |
valign[get]
|
ubyte | vertical alignment: Top / VCenter / Bottom |
Methods
| Name | Description |
|---|---|
createSubstyle
(id)
|
create new named style or get existing |
customColor
(id, defColor)
|
get custom color attribute - transparent by default |
customDrawable
(id)
|
get custom drawable attribute |
customDrawableId
(id)
|
get custom drawable attribute |
customLength
(id, defValue)
|
get custom color attribute - transparent by default |
dumpStats
()
|
|
forState
(state)
|
find substyle based on widget state (e.g. focused, pressed, ...) |
modifyStyle
(id)
|
create wrapper style which will have currentTheme.get(id) as parent instead of fixed parent - to modify some base style properties in widget |
onThemeChanged
()
|
|
clearCachedObjects
()
|
|
clone
()
|
|
createState
(stateMask, stateValue)
|
create state substyle for this style |
getOrCreateState
(stateMask, stateValue)
|
find exact existing state style or create new if no matched styles found |
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
| Name | Description |
|---|---|
~this
|