Saltar al contenido principal

Clase: TouchBarScrubber

Clase: TouchBarScrubber

Crear un depurador (un selector de desplazamiento)

Proceso: Main
Esta clase no está exportada desde el módulo 'electron'. Sólo está disponible como un valor de retorno de otros métodos en la API de Electron.

new TouchBarScrubber(options)

  • options Object
    • elementos elemento a depurar[] - Un arreglo de elementos a depurar.
    • select Function (optional) - Called when the user taps an item that was not the last tapped item.
      • seleccionar índice Entero - El índice del elemento que el usuario seleccionó.
    • highlight Function (optional) - Called when the user taps any item.
      • índice destacado Entero - El índice del elemento que el usuario tocó.
    • selectedStyle string (opcional) - Estilo de elemento seleccionado. Puede ser background, outline o none. Por defecto es none.
    • overlayStyle string (opcional) - Estilo de elemento de superposición seleccionado. Puede ser background, outline o none. Por defecto es none.
    • showArrowButtons boolean (optional) - Whether to show arrow buttons. Defaults to false and is only shown if items is non-empty.
    • mode string (opcional) - Puede ser fixed o free. Por defecto es free.
    • continuous boolean (opcional) - Por defecto a true.

Propiedades de la instancia

Las siguientes propiedades está disponibles en instancias del depurador de barra tactil:

touchBarScrubber.items

Un array de ScrubberItem[] representando los elementos en este depurador. Actualiza este valor inmediatamente actualiza el control de la barra táctil. Mientras se actualicen las propiedades profundas dentro de este arreglo no se actualiza la barra táctil.

touchBarScrubber.selectedStyle

A string representing the style that selected items in the scrubber should have. Actualiza este valor inmediatamente actualiza el control de la barra táctil. Posibles valores:

  • background - Mapa a [NSScrubberSelectionStyle roundedBackgroundStyle].
  • outline - Mapa a [NSScrubberSelectionStyle outlineOverlayStyle].
  • none - Elimina todos los estilos.

touchBarScrubber.overlayStyle

A string representing the style that selected items in the scrubber should have. Este estilo es cubierto en la parte superior del elemento depurador en vez de posicionarse detrás de él. Actualizar este valor inmediatamente actualiza el control en la barra de herramientas. Posibles valores:

  • background - Mapa a [NSScrubberSelectionStyle roundedBackgroundStyle].
  • outline - Mapa a [NSScrubberSelectionStyle outlineOverlayStyle].
  • none - Elimina todos los estilos.

touchBarScrubber.showArrowButtons

A boolean representing whether to show the left / right selection arrows in this scrubber. Actualizar este valor inmediatamente actualiza el control en el touch bar.

touchBarScrubber.mode

Un string que representa el modo de este depurador. Actualiza este valor inmediatamente actualiza el control de la barra táctil. Posibles valores:

  • fijo - Mapa a NSScrubberModeFixed.
  • libre - Mapa a NSScrubberModeFree.

touchBarScrubber.continuous

Un boolean que representa si este depurador es continuo o no. Actualiza este valor inmediatamente actualiza el control de la barra táctil.