Provides styling for Widgets.

Hierarchy (view full)

Constructors

Properties

subscribers: Set<((property: null | string) => void)>

Listeners that are listening for changes in this theme (or fallback)

Accessors

  • get backgroundFill(): FillStyle
  • The background fill style. Used for widgets with a background (as in, a background above the canvas background).

    Returns FillStyle

  • set backgroundFill(value): void
  • The background fill style. Used for widgets with a background (as in, a background above the canvas background).

    Parameters

    Returns void

  • get blinkRate(): number
  • The blink rate of text cursors in text input widgets like TextInput. Value in "blinks" per second.

    Returns number

  • set blinkRate(value): void
  • The blink rate of text cursors in text input widgets like TextInput. Value in "blinks" per second.

    Parameters

    • value: undefined | number

    Returns void

  • get bodyTextAlign(): number
  • The default text alignment mode of body text (most regular text).

    Returns number

  • set bodyTextAlign(value): void
  • The default text alignment mode of body text (most regular text).

    Parameters

    • value: undefined | number

    Returns void

  • get bodyTextFont(): string
  • The font style used for body text (most regular text).

    Returns string

  • set bodyTextFont(value): void
  • The font style used for body text (most regular text).

    Parameters

    • value: undefined | string

    Returns void

  • get bodyTextHeight(): null | number
  • The height of each line of text in body text (most regular text). If null, it will be automatically detected.

    Returns null | number

  • set bodyTextHeight(value): void
  • The height of each line of text in body text (most regular text). If null, it will be automatically detected.

    Parameters

    • value: undefined | null | number

    Returns void

  • get bodyTextSpacing(): null | number
  • The spacing between each line of text in body text (most regular text). If null, it will be automatically detected.

    Returns null | number

  • set bodyTextSpacing(value): void
  • The spacing between each line of text in body text (most regular text). If null, it will be automatically detected.

    Parameters

    • value: undefined | null | number

    Returns void

  • get checkboxInnerPadding(): number
  • The Padding used for Checkbox between the accent box shown when ticked and the background box.

    Returns number

  • set checkboxInnerPadding(value): void
  • The Padding used for Checkbox between the accent box shown when ticked and the background box.

    Parameters

    • value: undefined | number

    Returns void

  • get checkboxLength(): number
  • The length in pixels used for Checkbox.

    Returns number

  • set checkboxLength(value): void
  • The length in pixels used for Checkbox.

    Parameters

    • value: undefined | number

    Returns void

  • get cursorIndicatorSize(): number
  • The side length of a text cursor's indicator in pixels. For now there is only a tab mode indicator.

    Returns number

  • set cursorIndicatorSize(value): void
  • The side length of a text cursor's indicator in pixels. For now there is only a tab mode indicator.

    Parameters

    • value: undefined | number

    Returns void

  • get cursorThickness(): number
  • The thickness of a text cursor in pixels.

    Returns number

  • set cursorThickness(value): void
  • The thickness of a text cursor in pixels.

    Parameters

    • value: undefined | number

    Returns void

  • get fallbackTheme(): undefined | Theme
  • The fallback theme. If this theme has a missing property, the fallback theme's property will be used instead. This will automatically (un)subscribe to/from the fallback theme.

    Returns undefined | Theme

  • set fallbackTheme(newTheme): void
  • The fallback theme. If this theme has a missing property, the fallback theme's property will be used instead. This will automatically (un)subscribe to/from the fallback theme.

    Parameters

    • newTheme: undefined | Theme

    Returns void

  • get inputTextAlign(): number
  • The default text alignment mode of text input widgets like TextInput.

    Returns number

  • set inputTextAlign(value): void
  • The default text alignment mode of text input widgets like TextInput.

    Parameters

    • value: undefined | number

    Returns void

  • get inputTextHeight(): null | number
  • The height of each line of text in input widgets like TextInput. If null, it will be automatically detected.

    Returns null | number

  • set inputTextHeight(value): void
  • The height of each line of text in input widgets like TextInput. If null, it will be automatically detected.

    Parameters

    • value: undefined | null | number

    Returns void

  • get inputTextMinWidth(): number
  • The default minimum width of text input widgets like TextInput.

    Returns number

  • set inputTextMinWidth(value): void
  • The default minimum width of text input widgets like TextInput.

    Parameters

    • value: undefined | number

    Returns void

  • get inputTextSpacing(): null | number
  • The spacing between each line of text in input widgets like TextInput. If null, it will be automatically detected.

    Returns null | number

  • set inputTextSpacing(value): void
  • The spacing between each line of text in input widgets like TextInput. If null, it will be automatically detected.

    Parameters

    • value: undefined | null | number

    Returns void

  • get multiContainerSpacing(): number
  • The spacing length between widgets in MultiContainer.

    Returns number

  • set multiContainerSpacing(value): void
  • The spacing length between widgets in MultiContainer.

    Parameters

    • value: undefined | number

    Returns void

  • get scrollBarMinPercent(): number
  • The minimum length of the filled part of a ScrollableViewportWidget's scrollbar in percentage of total length.

    Returns number

  • set scrollBarMinPercent(value): void
  • The minimum length of the filled part of a ScrollableViewportWidget's scrollbar in percentage of total length.

    Parameters

    • value: undefined | number

    Returns void

  • get sliderMinLength(): number
  • The minimum length of a Slider

    Returns number

  • set sliderMinLength(value): void
  • The minimum length of a Slider

    Parameters

    • value: undefined | number

    Returns void

  • get sliderThickness(): number
  • The thickness of a Slider

    Returns number

  • set sliderThickness(value): void
  • The thickness of a Slider

    Parameters

    • value: undefined | number

    Returns void

Methods

  • Called when the fallback theme changes. Does nothing by default.

    Parameters

    • property: null | string = null

      The property name of the theme property that was updated. If a general theme update, then this will be null and all theme properties should be treated as changed.

    Returns void

  • Subscribe to this theme. When a change occurs in the theme, the passed listener callback will be called. The argument used for the callback will be null if the theme's fallback has changed and therefore all properties are to be assumed as changed, else, the argument will be a string containing the name of the theme property that changed.

    Parameters

    • listener: ((property: null | string) => void)
        • (property): void
        • Parameters

          • property: null | string

          Returns void

    Returns void

  • Unsubscribe from this theme; removes the listener callback from the list of subscribers.

    Parameters

    • listener: ((property: null | string) => void)
        • (property): void
        • Parameters

          • property: null | string

          Returns void

    Returns void