gioui

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfirmQuit = iota
	ConfirmLoad
	ConfirmNew
)
View Source
const CAN_QUIT = true

Variables

This section is empty.

Functions

func HighEmphasisButton added in v0.2.0

func HighEmphasisButton(th *material.Theme, w *widget.Clickable, text string) material.ButtonStyle

func Label

func Label(str string, color color.NRGBA, shaper *text.Shaper) layout.Widget

func LowEmphasisButton added in v0.2.0

func LowEmphasisButton(th *material.Theme, w *widget.Clickable, text string) material.ButtonStyle

func Tooltip added in v0.2.0

func Tooltip(th *material.Theme, tip string) component.Tooltip

Types

type Alert

type Alert struct {
	// contains filtered or unexported fields
}

func (*Alert) Layout

func (a *Alert) Layout(gtx C) D

func (*Alert) Update

func (a *Alert) Update(message string, alertType AlertType, duration time.Duration)

type AlertType

type AlertType int
const (
	None AlertType = iota
	Notify
	Warning
	Error
)

type C

type C = layout.Context

type D

type D = layout.Dimensions

type Dialog

type Dialog struct {
	Visible   bool
	BtnAlt    widget.Clickable
	BtnOk     widget.Clickable
	BtnCancel widget.Clickable
}

type DialogStyle

type DialogStyle struct {
	Text        string
	Inset       layout.Inset
	ShowAlt     bool
	AltStyle    material.ButtonStyle
	OkStyle     material.ButtonStyle
	CancelStyle material.ButtonStyle
	Shaper      *text.Shaper
	// contains filtered or unexported fields
}

func ConfirmDialog

func ConfirmDialog(th *material.Theme, dialog *Dialog, text string, shaper *text.Shaper) DialogStyle

func (*DialogStyle) Layout

func (d *DialogStyle) Layout(gtx C) D

type DragList

type DragList struct {
	SelectedItem  int
	SelectedItem2 int
	HoverItem     int
	List          *layout.List
	// contains filtered or unexported fields
}

func (*DragList) Focus added in v0.2.0

func (d *DragList) Focus()

func (*DragList) Focused added in v0.2.0

func (d *DragList) Focused() bool

type FilledDragListStyle

type FilledDragListStyle struct {
	HoverColor    color.NRGBA
	SelectedColor color.NRGBA
	CursorColor   color.NRGBA
	Count         int
	// contains filtered or unexported fields
}

func FilledDragList

func FilledDragList(th *material.Theme, dragList *DragList, count int, element func(gtx C, i int) D, swap func(i, j int)) FilledDragListStyle

func (*FilledDragListStyle) Layout

func (s *FilledDragListStyle) Layout(gtx C) D

type InstrumentEditor added in v0.2.0

type InstrumentEditor struct {
	// contains filtered or unexported fields
}

func NewInstrumentEditor added in v0.2.0

func NewInstrumentEditor() *InstrumentEditor

func (*InstrumentEditor) ChildFocused added in v0.2.0

func (ie *InstrumentEditor) ChildFocused() bool

func (*InstrumentEditor) ExpandComment added in v0.2.0

func (t *InstrumentEditor) ExpandComment()

func (*InstrumentEditor) Focus added in v0.2.0

func (ie *InstrumentEditor) Focus()

func (*InstrumentEditor) Focused added in v0.2.0

func (ie *InstrumentEditor) Focused() bool

func (*InstrumentEditor) Layout added in v0.2.0

func (ie *InstrumentEditor) Layout(gtx C, t *Tracker) D

type LabelStyle

type LabelStyle struct {
	Text       string
	Color      color.NRGBA
	ShadeColor color.NRGBA
	Alignment  layout.Direction
	Font       font.Font
	FontSize   unit.Sp
	Shaper     *text.Shaper
}

func (LabelStyle) Layout

func (l LabelStyle) Layout(gtx layout.Context) layout.Dimensions
type Menu struct {
	Visible bool
	// contains filtered or unexported fields
}
func (m *Menu) Clicked() (int, bool)
type MenuItem struct {
	IconBytes    []byte
	Text         string
	ShortcutText string
	Disabled     bool
}
type MenuStyle struct {
	Menu          *Menu
	Title         string
	IconColor     color.NRGBA
	TextColor     color.NRGBA
	ShortCutColor color.NRGBA
	FontSize      unit.Sp
	IconSize      unit.Dp
	HoverColor    color.NRGBA
	Shaper        *text.Shaper
}
func (m *MenuStyle) Layout(gtx C, items ...MenuItem) D

type NumberInput

type NumberInput struct {
	Value int
	// contains filtered or unexported fields
}

type NumericUpDownStyle

type NumericUpDownStyle struct {
	NumberInput     *NumberInput
	Min             int
	Max             int
	Color           color.NRGBA
	Font            font.Font
	TextSize        unit.Sp
	BorderColor     color.NRGBA
	IconColor       color.NRGBA
	BackgroundColor color.NRGBA
	CornerRadius    unit.Dp
	Border          unit.Dp
	ButtonWidth     unit.Dp
	UnitsPerStep    unit.Dp
	Tooltip         component.Tooltip
	Width           unit.Dp
	Height          unit.Dp
	// contains filtered or unexported fields
}

func NumericUpDown

func NumericUpDown(th *material.Theme, number *NumberInput, min, max int, tooltip string) NumericUpDownStyle

func (*NumericUpDownStyle) Layout

func (s *NumericUpDownStyle) Layout(gtx C) D

type OrderEditor added in v0.2.0

type OrderEditor struct {
	// contains filtered or unexported fields
}

func NewOrderEditor added in v0.2.0

func NewOrderEditor() *OrderEditor

func (*OrderEditor) Focus added in v0.2.0

func (oe *OrderEditor) Focus()

func (*OrderEditor) Focused added in v0.2.0

func (oe *OrderEditor) Focused() bool

func (*OrderEditor) Layout added in v0.2.0

func (oe *OrderEditor) Layout(gtx C, t *Tracker) D

type ParamEditor added in v0.2.0

type ParamEditor struct {
	Parameters         []*ParameterWidget
	DeleteUnitBtn      *TipClickable
	CopyUnitBtn        *TipClickable
	ClearUnitBtn       *TipClickable
	ChooseUnitTypeBtns []*widget.Clickable
	// contains filtered or unexported fields
}

func NewParamEditor added in v0.2.0

func NewParamEditor() *ParamEditor

func (*ParamEditor) Bind added in v0.2.0

func (pe *ParamEditor) Bind(t *Tracker) layout.Widget

func (*ParamEditor) Focus added in v0.2.0

func (pe *ParamEditor) Focus()

func (*ParamEditor) Focused added in v0.2.0

func (pe *ParamEditor) Focused() bool

type ParameterStyle

type ParameterStyle struct {
	Parameter       *tracker.Parameter
	ParameterWidget *ParameterWidget
	Theme           *material.Theme
	Focus           bool
	// contains filtered or unexported fields
}

func (ParameterStyle) Layout

func (p ParameterStyle) Layout(gtx C) D

type ParameterWidget

type ParameterWidget struct {
	// contains filtered or unexported fields
}

func (*ParameterWidget) Clicked

func (p *ParameterWidget) Clicked() bool

type PopupStyle

type PopupStyle struct {
	Visible        *bool
	SurfaceColor   color.NRGBA
	ShadowColor    color.NRGBA
	ShadowN        unit.Dp
	ShadowE        unit.Dp
	ShadowW        unit.Dp
	ShadowS        unit.Dp
	SE, SW, NW, NE unit.Dp
}
func Popup(visible *bool) PopupStyle

func (PopupStyle) Layout

func (s PopupStyle) Layout(gtx C, contents layout.Widget) D

type ScrollBar

type ScrollBar struct {
	Axis layout.Axis
	// contains filtered or unexported fields
}

func (*ScrollBar) Layout

func (s *ScrollBar) Layout(gtx C, width unit.Dp, numItems int, pos *layout.Position) D

type Split

type Split struct {
	// Ratio keeps the current layout.
	// 0 is center, -1 completely to the left, 1 completely to the right.
	Ratio float32
	// Bar is the width for resizing the layout
	Bar unit.Dp
	// Axis is the split direction: layout.Horizontal splits the view in left
	// and right, layout.Vertical splits the view in top and bottom
	Axis layout.Axis
	// contains filtered or unexported fields
}

func (*Split) Layout

func (s *Split) Layout(gtx layout.Context, first, second layout.Widget) layout.Dimensions

type Surface

type Surface struct {
	Gray    int
	Inset   layout.Inset
	FitSize bool
	Focus   bool
}

func (Surface) Layout

func (s Surface) Layout(gtx C, widget layout.Widget) D

type TipClickable added in v0.2.0

type TipClickable struct {
	Clickable widget.Clickable
	TipArea   component.TipArea
}

type TipIconButtonStyle added in v0.2.0

type TipIconButtonStyle struct {
	IconButtonStyle material.IconButtonStyle
	Tooltip         component.Tooltip
	// contains filtered or unexported fields
}

func IconButton added in v0.2.0

func IconButton(th *material.Theme, w *TipClickable, icon []byte, enabled bool, tip string) TipIconButtonStyle

func (*TipIconButtonStyle) Layout added in v0.2.0

func (t *TipIconButtonStyle) Layout(gtx C) D

type TrackEditor added in v0.2.0

type TrackEditor struct {
	TrackVoices         *NumberInput
	NewTrackBtn         *TipClickable
	DeleteTrackBtn      *TipClickable
	AddSemitoneBtn      *widget.Clickable
	SubtractSemitoneBtn *widget.Clickable
	AddOctaveBtn        *widget.Clickable
	SubtractOctaveBtn   *widget.Clickable
	NoteOffBtn          *widget.Clickable
	// contains filtered or unexported fields
}

func NewTrackEditor added in v0.2.0

func NewTrackEditor() *TrackEditor

func (*TrackEditor) ChildFocused added in v0.2.0

func (te *TrackEditor) ChildFocused() bool

func (*TrackEditor) Focus added in v0.2.0

func (te *TrackEditor) Focus()

func (*TrackEditor) Focused added in v0.2.0

func (te *TrackEditor) Focused() bool

func (*TrackEditor) Layout added in v0.2.0

func (te *TrackEditor) Layout(gtx layout.Context, t *Tracker) layout.Dimensions

type Tracker

type Tracker struct {
	Theme                 *material.Theme
	MenuBar               []widget.Clickable
	Menus                 []Menu
	OctaveNumberInput     *NumberInput
	BPM                   *NumberInput
	RowsPerPattern        *NumberInput
	RowsPerBeat           *NumberInput
	Step                  *NumberInput
	InstrumentVoices      *NumberInput
	SongLength            *NumberInput
	PanicBtn              *widget.Clickable
	RecordBtn             *widget.Clickable
	AddUnitBtn            *widget.Clickable
	TrackHexCheckBox      *widget.Bool
	TopHorizontalSplit    *Split
	BottomHorizontalSplit *Split
	VerticalSplit         *Split
	KeyPlaying            map[string]tracker.NoteID
	Alert                 Alert
	ConfirmSongDialog     *Dialog
	WaveTypeDialog        *Dialog
	ConfirmSongActionType int
	ModalDialog           layout.Widget
	InstrumentEditor      *InstrumentEditor
	OrderEditor           *OrderEditor
	TrackEditor           *TrackEditor
	Explorer              *explorer.Explorer

	TextShaper *text.Shaper
	// contains filtered or unexported fields
}

func NewTracker added in v0.2.0

func NewTracker(model *tracker.Model, synther sointu.Synther) *Tracker

func (*Tracker) ExportWav added in v0.2.0

func (t *Tracker) ExportWav(pcm16 bool)

func (*Tracker) JammingPressed added in v0.2.0

func (t *Tracker) JammingPressed(e key.Event) byte

func (*Tracker) JammingReleased added in v0.2.0

func (t *Tracker) JammingReleased(e key.Event) bool

func (*Tracker) KeyEvent

func (t *Tracker) KeyEvent(e key.Event, o *op.Ops)

KeyEvent handles incoming key events and returns true if repaint is needed.

func (*Tracker) Layout

func (t *Tracker) Layout(gtx layout.Context, w *app.Window)

func (*Tracker) LoadInstrument added in v0.2.0

func (t *Tracker) LoadInstrument()

func (*Tracker) Main added in v0.2.0

func (t *Tracker) Main()

func (*Tracker) NewSong added in v0.2.0

func (t *Tracker) NewSong(forced bool)

func (*Tracker) NumberPressed

func (t *Tracker) NumberPressed(iv byte)

NumberPressed handles incoming presses while in either of the hex number columns

func (*Tracker) OpenSongFile added in v0.2.0

func (t *Tracker) OpenSongFile(forced bool)

func (*Tracker) ParamStyle

func (t *Tracker) ParamStyle(th *material.Theme, param *tracker.Parameter, paramWidget *ParameterWidget) ParameterStyle

func (*Tracker) PopupMenu added in v0.3.0

func (t *Tracker) PopupMenu(menu *Menu) MenuStyle

func (*Tracker) Quit added in v0.2.0

func (t *Tracker) Quit(forced bool) bool

func (*Tracker) SafeMarshalRecovery added in v0.3.0

func (t *Tracker) SafeMarshalRecovery() []byte

thread safe, executed in the GUI thread

func (*Tracker) SafeUnmarshalRecovery added in v0.3.0

func (t *Tracker) SafeUnmarshalRecovery(data []byte)

thread safe, executed in the GUI thread

func (*Tracker) SaveInstrument added in v0.2.0

func (t *Tracker) SaveInstrument()

func (*Tracker) SaveSongAsFile

func (t *Tracker) SaveSongAsFile()

func (*Tracker) SaveSongFile

func (t *Tracker) SaveSongFile() bool

func (*Tracker) UnmarshalContent

func (t *Tracker) UnmarshalContent(bytes []byte) error

func (*Tracker) WaitQuitted added in v0.3.0

func (t *Tracker) WaitQuitted()

type VuMeter

type VuMeter struct {
	AverageVolume tracker.Volume
	PeakVolume    tracker.Volume
	Range         float32
}

func (VuMeter) Layout

func (v VuMeter) Layout(gtx C) D

Jump to

Keyboard shortcuts

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