Files
silver_pose/v2/vendor/gioui.org/widget/material/doc.go
T
ilaandClaude Opus 4.8 f58728cddd chore(v2): vendor dependencies for offline/China builds
go mod vendor pins onnxruntime_go v1.12.1, Gio and the rest into v2/vendor
so go run/build work without hitting proxy.golang.org (blocked/slow in
China). Verified: CGO_ENABLED=1 go build -mod=vendor ./internal/spike and
GOOS=windows go build -mod=vendor ./internal/ui both pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 16:35:01 +08:00

60 lines
2.0 KiB
Go

// SPDX-License-Identifier: Unlicense OR MIT
// Package material implements the Material design.
//
// To maximize reusability and visual flexibility, user interface controls are
// split into two parts: the stateful widget and the stateless drawing of it.
//
// For example, widget.Clickable encapsulates the state and event
// handling of all clickable areas, while the Theme is responsible to
// draw a specific area, for example a button.
//
// This snippet defines a button that prints a message when clicked:
//
// var gtx layout.Context
// button := new(widget.Clickable)
//
// for button.Clicked(gtx) {
// fmt.Println("Clicked!")
// }
//
// Use a Theme to draw the button:
//
// theme := material.NewTheme(...)
//
// material.Button(theme, button, "Click me!").Layout(gtx)
//
// # Customization
//
// Quite often, a program needs to customize the theme-provided defaults. Several
// options are available, depending on the nature of the change.
//
// Mandatory parameters: Some parameters are not part of the widget state but
// have no obvious default. In the program above, the button text is a
// parameter to the Theme.Button method.
//
// Theme-global parameters: For changing the look of all widgets drawn with a
// particular theme, adjust the `Theme` fields:
//
// theme.Palette.Fg = color.NRGBA{...}
//
// Widget-local parameters: For changing the look of a particular widget,
// adjust the widget specific theme object:
//
// btn := material.Button(theme, button, "Click me!")
// btn.Font.Style = text.Italic
// btn.Layout(gtx)
//
// Widget variants: A widget can have several distinct representations even
// though the underlying state is the same. A widget.Clickable can be drawn as a
// round icon button:
//
// icon := widget.NewIcon(...)
//
// material.IconButton(theme, button, icon, "Click me!").Layout(gtx)
//
// Specialized widgets: Theme both define a generic Label method
// that takes a text size, and specialized methods for standard text
// sizes such as Theme.H1 and Theme.Body2.
package material