page

package
v0.0.0-...-caf0cee Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT, Unlicense Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MainWindow

func MainWindow(win *app.Window, conn bus.Connection) error

MainWindow initializes the primary UI view and attaches it to the window.

func Window

func Window(page func(th *theme.Th, conn bus.Connection) router.Page) window.WindowFunc

Window returns a window func that shows the given page. Page is constructed with the application bus.

Types

type C

type C = layout.Context

type Chat

type Chat struct {
	*theme.Th

	bus.Connection

	SplitIntoWindowBtn widget.Clickable
	// contains filtered or unexported fields
}

Chat shows chat messages.

func (*Chat) Layout

func (p *Chat) Layout(gtx C) D

func (*Chat) Mount

func (p *Chat) Mount()

func (*Chat) Unmount

func (p *Chat) Unmount()

func (*Chat) Update

func (p *Chat) Update(data any) bool

type D

type D = layout.Dimensions
type Gallery struct {
	*theme.Th

	bus.Connection

	SplitIntoWindowBtn widget.Clickable
	// contains filtered or unexported fields
}

Gallery page displays a gallery of images.

func (*Gallery) Layout

func (p *Gallery) Layout(gtx C) D

func (*Gallery) Update

func (p *Gallery) Update(data any) bool

Update consumes data updates.

type GalleryImage

type GalleryImage struct {
	Title string
	Src   paint.ImageOp
}

GalleryImage describes an image to display in the gallery.

type Home

type Home struct {
	*theme.Th
	bus.Connection

	ChangeThemeBtn widget.Clickable
}

Home implements the home page.

func (*Home) Layout

func (p *Home) Layout(gtx C) D

func (*Home) Update

func (p *Home) Update(data any) bool

type Message

type Message struct {
	Text string
	Sent time.Time
}

Message contains some text.

type PaletteChangedEvent

type PaletteChangedEvent struct {
	theme.Palette
}

PaletteChangedEvent when the application color palette has changed.

type UI

type UI struct {
	*theme.Th
	bus.Connection
	// SidePanel shows the global side panel for navigation.
	SidePanel widget.SidePanel
	// NavSlugs shows the global slugs for navigation.
	NavSlugs widget.NavSlugs
	// Pages maintains inter-page state, such as history.
	Pages router.Router
}

UI maintains state for the entire user interface.

func (*UI) Layout

func (ui *UI) Layout(gtx C) D

Layout shows the UI.

func (*UI) LayoutNavSlugs

func (ui *UI) LayoutNavSlugs(gtx C) D

LayoutNavSlugs shows the navigation history in an ordered list.

func (*UI) Update

func (ui *UI) Update(up any) bool

Update the UI state based on external messages.

Jump to

Keyboard shortcuts

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