LabelView
A themed text label for UI forms and layouts.
LabelView extends TextView with theme integration and automatic styling based on the current theme and state. It provides consistent text appearance across the UI with support for bold text and disabled states.
Features:
- Automatic theme-based styling
- Bold text support
- Disabled state with appropriate visual feedback
- Consistent font and color management
- Automatic sizing with fill width and minimum height
Example usage:
var label = new LabelView();
label.content = "Username:";
label.bold = true;
label.disabled = false;
Instance Members
Default is false
, automatically set to true
when any of this instance's observable variables has changed.
Custom theme override for this label
Whether to display the text in bold font
Whether the label appears disabled (affects text color)
Creates a new LabelView instance.
Initializes the label with default properties:
- Full width with auto height
- Minimum height of 16 pixels
- Left alignment with center vertical alignment
- 12pt text size with 20pt pre-rendered size
- Automatic style updates based on theme changes
Private Members
Event when any observable value as changed on this instance.
Name | Type |
---|---|
instance |
LabelView |
fromSerializedField |
Bool |
Event when theme field changes.
Name | Type |
---|---|
current |
Theme |
previous |
Theme |
Event when bold field changes.
Name | Type |
---|---|
current |
Bool |
previous |
Bool |
Event when disabled field changes.
Name | Type |
---|---|
current |
Bool |
previous |
Bool |
Updates the visual styling based on current theme and state.
Applies appropriate styling from the current theme:
- Text color: darkTextColor when disabled, lightTextColor when enabled
- Font: boldFont when bold is true, mediumFont otherwise
Falls back to the global context theme if no custom theme is set. This method is called automatically when theme, bold, or disabled properties change.
Metadata
Name | Parameters |
---|---|
:build |
tracker.macros.ObservableMacro.build() |
:autoBuild |
tracker.macros.ObservableMacro.build() |
:build |
tracker.macros.EventsMacro.build() |
:autoBuild |
tracker.macros.EventsMacro.build() |
:build |
ceramic.macros.EntityMacro.buildForCompletion() |
:autoBuild |
ceramic.macros.EntityMacro.buildForCompletion() |