barbuilder

package
v0.0.0-...-de47427 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Button

type Button struct {
	CommonProperties

	Title      string
	Image      Image
	Disabled   bool
	BezelColor Color
	OnClick    ButtonOnClick
}

type ButtonOnClick

type ButtonOnClick func()

type Candidates

type Candidates struct {
	CommonProperties

	Candidates []string
	ForString  string
	ForRange   [2]int

	AllowsCollapsing                 bool
	StartsCollapsed                  bool
	Visible                          bool
	AllowsTextInputContextCandidates bool
}

type Color

type Color interface {
	// contains filtered or unexported methods
}

Color represents a color usable by macOS

type ColorPicker

type ColorPicker struct {
	CommonProperties

	Kind       ColorPickerKind
	ShowsAlpha bool
	Disabled   bool
	OnSelected ColorPickerOnSelected
}

type ColorPickerColor

type ColorPickerColor struct {
	RGB RGBAColor
}

type ColorPickerKind

type ColorPickerKind string
const (
	ColorPickerStandard ColorPickerKind = "standard"
	ColorPickerText     ColorPickerKind = "text"
	ColorPickerStroke   ColorPickerKind = "stroke"
)

type ColorPickerOnSelected

type ColorPickerOnSelected func(color ColorPickerColor)

type CommonProperties

type CommonProperties struct {
	// Priority informs macOS on which items to hide first, see `ItemPriority` for more details.
	Priority ItemPriority
	// Principal will position the `Item` at the center of the bar
	Principal bool
}

CommonProperties describes attributes supported by all `Item`s

type Configuration

type Configuration struct {
	// Items are the items to be displayed in your Touch Bar
	Items []Item
	// Escape is an optional setting to have a custom escape button to close you Touch Bar
	Escape *Item
}

Configuration represents the UI setup of your Touch Bar

type ContentImage

type ContentImage struct {
	Image Image
}

ContentImage displays an image

type ContentLabel

type ContentLabel struct {
	Text  string
	Color Color
}

ContentLabel displays some text with an optional color

type Custom

type Custom struct {
	CommonProperties

	OnEvent CustomOnEvent
}

type CustomEvent

type CustomEvent struct {
	Event CustomEventKind
	X     float32
}

type CustomEventKind

type CustomEventKind string
const (
	CustomEventChanged CustomEventKind = "changed"
	CustomEventEnded   CustomEventKind = "ended"
)

type CustomOnEvent

type CustomOnEvent func(event CustomEvent)

type Group

type Group struct {
	CommonProperties

	Direction          GroupDirection
	Children           []Item
	PrefersEqualWidth  bool
	PreferredItemWidth float32 // only used when PrefersEqualWidth is true
}

type GroupDirection

type GroupDirection string
const (
	GroupMatchApp    GroupDirection = "app"
	GroupLeftToRight GroupDirection = "left_to_right"
	GroupRightToLeft GroupDirection = "right_to_left"
)

type HexColor

type HexColor string

HexColor represents a color in sRGB color given as a CSS color string, e.g. `#ff34ad` Note: it does not support alpha channel, if you need opacity, use `RGBAColor`

type Image

type Image interface {
	// contains filtered or unexported methods
}

Image represents an image usable by macOS

type Item

type Item interface {
	// contains filtered or unexported methods
}

Item represents a UI element that can be rendered in a Touch Bar by macOS

type ItemPriority

type ItemPriority float32

ItemPriority informs macOS on which items to hide first when space becomes constrained Lower priority elements are hidden first. Note: you can use custom value if you need more granularity than the pre-defined defaults

const (
	ItemPriorityLow    ItemPriority = -1000
	ItemPriorityMedium ItemPriority = 0
	ItemPriorityHigh   ItemPriority = 1000
)

type Label

type Label struct {
	CommonProperties

	Content View
}

type Options

type Options struct {
	// EventErrorLogger will be called if any internal error arise
	// when handling events coming from interaction with your `Configuration`
	EventErrorLogger func(err error)
}

Options specifies the different settings available when creating a new Touch Bar

type OtherItemsProxy

type OtherItemsProxy struct {
}

type Picker

type Picker struct {
	CommonProperties

	Items           []View
	SingleSelection bool
	Collapsed       bool
	OnSelected      PickerOnSelected
}

type PickerOnSelected

type PickerOnSelected func(i int)

type Popover

type Popover struct {
	CommonProperties

	CollapsedText  string
	CollapsedImage Image
	Bar            []Item
	PressAndHold   bool
}

type RGBAColor

type RGBAColor struct {
	Red   float32
	Green float32
	Blue  float32
	Alpha float32
}

RGBAColor represents a color in sRGB space given through its individual components

type SFSymbol

type SFSymbol string

SFSymbol represents a standard Apple symbol compatible with the San Francisco font See https://developer.apple.com/sf-symbols/ for full list

type Scrubber

type Scrubber struct {
	CommonProperties

	Items            []View
	ShowsArrows      bool
	Mode             ScrubberMode
	SelectionOutline ScrubberOutline
	OnChange         ScrubberOnChange
}

type ScrubberMode

type ScrubberMode string
const (
	ScrubberModeFree  ScrubberMode = "free"
	ScrubberModeFixed ScrubberMode = "fixed"
)

type ScrubberOnChange

type ScrubberOnChange func(i int)

type ScrubberOutline

type ScrubberOutline string
const (
	ScrubberOutlineNone       ScrubberOutline = "none"
	ScrubberOutlineBackground ScrubberOutline = "background"
	ScrubberOutlineOutline    ScrubberOutline = "outline"
)

type Segment

type Segment struct {
	Label string
	Image Image
}

type SegmentedControl

type SegmentedControl struct {
	CommonProperties

	Segments       []Segment
	SelectMultiple bool
	OnClick        SegmentedOnClick
}

type SegmentedOnClick

type SegmentedOnClick func(clicked []bool)

type Sharer

type Sharer struct {
	CommonProperties

	ButtonImage Image
	ButtonLabel string
	Disabled    bool
}

type Slider

type Slider struct {
	CommonProperties

	Label            string
	StartValue       float64
	MinimumValue     float64
	MaximumValue     float64
	MinimumAccessory Image
	MaximumAccessory Image
	AccessoryWidth   SliderAccessoryWidth
	OnChange         SliderOnChange
}

type SliderAccessoryWidth

type SliderAccessoryWidth string
const (
	SliderAccessoryDefault SliderAccessoryWidth = "default"
	SliderAccessoryWide    SliderAccessoryWidth = "wide"
)

type SliderOnChange

type SliderOnChange func(value float64)

type SpaceFlexible

type SpaceFlexible struct {
}

type SpaceLarge

type SpaceLarge struct {
}

type SpaceSmall

type SpaceSmall struct {
}

type Stepper

type Stepper struct {
	CommonProperties

	Value     float64
	Minimum   float64
	Maximum   float64
	Increment float64
	Format    StepperFormat
	OnChange  StepperOnChange
}

type StepperFormat

type StepperFormat string
const (
	StepperNone       StepperFormat = "none"
	StepperDecimal    StepperFormat = "decimal"
	StepperPercent    StepperFormat = "percent"
	StepperScientific StepperFormat = "scientific"
	StepperOrdinal    StepperFormat = "ordinal"
	StepperCurrency   StepperFormat = "currency"
	StepperSpellOut   StepperFormat = "spell_out"
	StepperBytes      StepperFormat = "bytes"
	StepperDate       StepperFormat = "date"
	StepperDuration   StepperFormat = "duration"
)

type StepperOnChange

type StepperOnChange func(value float64)

type TBSymbol

type TBSymbol string

TBSymbol represents a standard TouchBar icon Note: if possible you should use `SFSymbol` instead See https://developer.apple.com/design/human-interface-guidelines/inputs/touch-bar/#interface-icons for full list and mapping to `SFSymbol`

const (
	TBAddDetailTemplate               TBSymbol = "TBAddDetailTemplate"
	TBAddTemplate                     TBSymbol = "TBAddTemplate"
	TBAlarmTemplate                   TBSymbol = "TBAlarmTemplate"
	TBAudioInputMuteTemplate          TBSymbol = "TBAudioInputMuteTemplate"
	TBAudioInputTemplate              TBSymbol = "TBAudioInputTemplate"
	TBAudioOutputMuteTemplate         TBSymbol = "TBAudioOutputMuteTemplate"
	TBAudioOutputVolumeHighTemplate   TBSymbol = "TBAudioOutputVolumeHighTemplate"
	TBAudioOutputVolumeLowTemplate    TBSymbol = "TBAudioOutputVolumeLowTemplate"
	TBAudioOutputVolumeMediumTemplate TBSymbol = "TBAudioOutputVolumeMediumTemplate"
	TBAudioOutputVolumeOffTemplate    TBSymbol = "TBAudioOutputVolumeOffTemplate"
	TBBookmarksTemplate               TBSymbol = "TBBookmarksTemplate"
	TBColorPickerFill                 TBSymbol = "TBColorPickerFill"
	TBColorPickerFont                 TBSymbol = "TBColorPickerFont"
	TBColorPickerStroke               TBSymbol = "TBColorPickerStroke"
	TBCommunicationAudioTemplate      TBSymbol = "TBCommunicationAudioTemplate"
	TBCommunicationVideoTemplate      TBSymbol = "TBCommunicationVideoTemplate"
	TBComposeTemplate                 TBSymbol = "TBComposeTemplate"
	TBDeleteTemplate                  TBSymbol = "TBDeleteTemplate"
	TBDownloadTemplate                TBSymbol = "TBDownloadTemplate"
	TBEnterFullScreenTemplate         TBSymbol = "TBEnterFullScreenTemplate"
	TBExitFullScreenTemplate          TBSymbol = "TBExitFullScreenTemplate"
	TBFastForwardTemplate             TBSymbol = "TBFastForwardTemplate"
	TBFolderCopyToTemplate            TBSymbol = "TBFolderCopyToTemplate"
	TBFolderMoveToTemplate            TBSymbol = "TBFolderMoveToTemplate"
	TBFolderTemplate                  TBSymbol = "TBFolderTemplate"
	TBGetInfoTemplate                 TBSymbol = "TBGetInfoTemplate"
	TBGoBackTemplate                  TBSymbol = "TBGoBackTemplate"
	TBGoDownTemplate                  TBSymbol = "TBGoDownTemplate"
	TBGoForwardTemplate               TBSymbol = "TBGoForwardTemplate"
	TBGoUpTemplate                    TBSymbol = "TBGoUpTemplate"
	TBHistoryTemplate                 TBSymbol = "TBHistoryTemplate"
	TBIconViewTemplate                TBSymbol = "TBIconViewTemplate"
	TBListViewTemplate                TBSymbol = "TBListViewTemplate"
	TBMailTemplate                    TBSymbol = "TBMailTemplate"
	TBNewFolderTemplate               TBSymbol = "TBNewFolderTemplate"
	TBNewMessageTemplate              TBSymbol = "TBNewMessageTemplate"
	TBOpenInBrowserTemplate           TBSymbol = "TBOpenInBrowserTemplate"
	TBPauseTemplate                   TBSymbol = "TBPauseTemplate"
	TBPlayheadTemplate                TBSymbol = "TBPlayheadTemplate"
	TBPlayPauseTemplate               TBSymbol = "TBPlayPauseTemplate"
	TBPlayTemplate                    TBSymbol = "TBPlayTemplate"
	TBQuickLookTemplate               TBSymbol = "TBQuickLookTemplate"
	TBRecordStartTemplate             TBSymbol = "TBRecordStartTemplate"
	TBRecordStopTemplate              TBSymbol = "TBRecordStopTemplate"
	TBRefreshTemplate                 TBSymbol = "TBRefreshTemplate"
	TBRewindTemplate                  TBSymbol = "TBRewindTemplate"
	TBRotateLeftTemplate              TBSymbol = "TBRotateLeftTemplate"
	TBRotateRightTemplate             TBSymbol = "TBRotateRightTemplate"
	TBSearchTemplate                  TBSymbol = "TBSearchTemplate"
	TBShareTemplate                   TBSymbol = "TBShareTemplate"
	TBSidebarTemplate                 TBSymbol = "TBSidebarTemplate"
	TBSkipAhead15SecondsTemplate      TBSymbol = "TBSkipAhead15SecondsTemplate"
	TBSkipAhead30SecondsTemplate      TBSymbol = "TBSkipAhead30SecondsTemplate"
	TBSkipAheadTemplate               TBSymbol = "TBSkipAheadTemplate"
	TBSkipBack15SecondsTemplate       TBSymbol = "TBSkipBack15SecondsTemplate"
	TBSkipBack30SecondsTemplate       TBSymbol = "TBSkipBack30SecondsTemplate"
	TBSkipBackTemplate                TBSymbol = "TBSkipBackTemplate"
	TBSkipToEndTemplate               TBSymbol = "TBSkipToEndTemplate"
	TBSkipToStartTemplate             TBSymbol = "TBSkipToStartTemplate"
	TBSlideshowTemplate               TBSymbol = "TBSlideshowTemplate"
	TBTagIconTemplate                 TBSymbol = "TBTagIconTemplate"
	TBTextBoldTemplate                TBSymbol = "TBTextBoldTemplate"
	TBTextBoxTemplate                 TBSymbol = "TBTextBoxTemplate"
	TBTextCenterAlignTemplate         TBSymbol = "TBTextCenterAlignTemplate"
	TBTextItalicTemplate              TBSymbol = "TBTextItalicTemplate"
	TBTextJustifiedAlignTemplate      TBSymbol = "TBTextJustifiedAlignTemplate"
	TBTextLeftAlignTemplate           TBSymbol = "TBTextLeftAlignTemplate"
	TBTextListTemplate                TBSymbol = "TBTextListTemplate"
	TBTextRightAlignTemplate          TBSymbol = "TBTextRightAlignTemplate"
	TBTextStrikethroughTemplate       TBSymbol = "TBTextStrikethroughTemplate"
	TBTextUnderlineTemplate           TBSymbol = "TBTextUnderlineTemplate"
	TBUserAddTemplate                 TBSymbol = "TBUserAddTemplate"
	TBUserGroupTemplate               TBSymbol = "TBUserGroupTemplate"
	TBUserTemplate                    TBSymbol = "TBUserTemplate"
)

type TouchBar

type TouchBar interface {
	// Install will associate the Touch Bar described by `config` to your main window
	Install(config Configuration) error

	// Debug is an alternative to `Install` which block the current thread to run a debug application
	// This is useful if you are developing/testing without a UI framework
	Debug(config Configuration) error

	// Update will update the currently installed Touch Bar using the provided `config`
	Update(config Configuration) error

	// Uninstall will remove
	Uninstall() error
}

TouchBar describes how to manipulate a Touch Bar

type View

type View interface {
	// contains filtered or unexported methods
}

View describes a piece of UI that macOS can render, usually this is used by elements that can be rendered in different ways (e.g. `Label`).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL