Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ThemeManager

A class that provides theme management.

Hierarchy

  • ThemeManager

Implements

Index

Constructors

constructor

Properties

Private _base

_base: string

Private _current

_current: string | null = null

Private _host

_host: Widget

Private _links

_links: HTMLLinkElement[] = []

Private _outstanding

_outstanding: Promise<void> | null = null

Private _pending

_pending: number = 0

Private _requests

_requests: object

Type declaration

  • [theme: string]: number

Private _settings

_settings: ISettings

Private _splash

_splash: ISplashScreen | null

Private _themeChanged

_themeChanged: Signal<this, IChangedArgs<string>> = new Signal<this, IChangedArgs<string>>(this)

Private _themes

_themes: object

Type declaration

Accessors

theme

  • get theme(): string | null

themeChanged

  • get themeChanged(): ISignal<this, IChangedArgs<string>>
  • A signal fired when the application theme changes.

    Returns ISignal<this, IChangedArgs<string>>

themes

  • get themes(): ReadonlyArray<string>
  • The names of the registered themes.

    Returns ReadonlyArray<string>

Methods

Private _loadSettings

  • _loadSettings(): void

Private _loadTheme

  • _loadTheme(theme: string): Promise<void>
  • Load the theme.

    Notes

    This method assumes that the theme exists.

    Parameters

    • theme: string

    Returns Promise<void>

Private _onError

  • _onError(reason: any): void

isLight

  • isLight(name: string): boolean
  • Test whether a given theme is light.

    Parameters

    • name: string

    Returns boolean

loadCSS

  • loadCSS(path: string): Promise<void>
  • Load a theme CSS file by path.

    Parameters

    • path: string

      The path of the file to load.

    Returns Promise<void>

register

  • register(theme: ITheme): IDisposable
  • Register a theme with the theme manager.

    Parameters

    • theme: ITheme

      The theme to register.

    Returns IDisposable

    A disposable that can be used to unregister the theme.

setTheme

  • setTheme(name: string): Promise<void>
  • Set the current theme.

    Parameters

    • name: string

    Returns Promise<void>

themeScrollbars

  • themeScrollbars(name: string): boolean
  • Test whether a given theme styles scrollbars, and if the user has scrollbar styling enabled.

    Parameters

    • name: string

    Returns boolean

Generated using TypeDoc