类型 Hit

API 文档由 Go 源码生成,内容为英文。

type Hit struct {
	ID       ID
	Bounds   Rect
	Label    string
	Value    string
	Hint     string
	Scope    ID
	Layer    uint16
	Role     Role
	Cursor   PointerCursor
	Disabled bool
	// FocusableDisabled is HitOptions.FocusableWhenDisabled.
	FocusableDisabled bool
	Checked           bool
	Mixed             bool
	Selected          bool
	Expanded          bool
	// Expandable is HitOptions.Expandable.
	Expandable bool
	Multiline  bool
	ReadOnly   bool
	Secure     bool
	Focusable  bool
	// Description, Level, PosInSet, SetSize, Live and Range are the
	// HitOptions fields of the same names.
	Description       string
	Level             uint8
	PosInSet, SetSize int32
	Live              LiveRegion
	Range             ValueRange
	// SkipTab is HitOptions.SkipTab.
	SkipTab bool
	// Autofocus is HitOptions.Autofocus.
	Autofocus bool
	// Block marks an opaque region rather than a target: it has no ID and no
	// accessibility node, and presses inside it reach nothing declared before it.
	Block bool
	// Container marks a semantic region with no target: a menu, listbox, grid,
	// heading or status area. It is not hit-testable and declares no control.
	Container bool
	// IsLabel marks a label of the control the ID names (see Canvas.HitLabel):
	// a press on it is a press on the control, it is no tab stop and no node of
	// its own, and its Label text names the control for assistive technology.
	IsLabel bool
	// Backdrop is HitOptions.Backdrop.
	Backdrop bool
	// MovesWindow marks a region of a custom-titlebar window that moves the
	// window when pressed (see Canvas.MoveRegion). It has no ID and no
	// accessibility node.
	MovesWindow bool
	// PassSecondary is HitOptions.PassSecondary.
	PassSecondary bool
	// PassPrimary is HitOptions.PassPrimary.
	PassPrimary bool
	// TextBounds, TextSize and TextColor are the text geometry declared through
	// HitOptions.
	TextBounds Rect
	TextSize   float32
	TextColor  Color
	// NavigationKeys is HitOptions.NavigationKeys.
	NavigationKeys bool
	// Placement is HitOptions.Placement.
	Placement TextPlacement
}

Hit is one pointer interaction region in back-to-front paint order. The zero ID is reserved for "no target". Label is the accessibility name of the region.