foundation

package
v0.1.122 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BorderStrokeUnspecified = &BorderStroke{
	Width: unit.DpUnspecified,
	Brush: graphics.BrushUnspecified,
}

1. BorderStrokeUnspecified is the sentinel singleton for an unspecified BorderStroke.

Functions

func EqualBorderStroke

func EqualBorderStroke(a, b *BorderStroke) bool

9. EqualBorderStroke returns true if a and b are semantically equal.

func IsSpecifiedBorderStroke

func IsSpecifiedBorderStroke(bs *BorderStroke) bool

2. IsSpecifiedBorderStroke returns true if the BorderStroke is specified (not nil and not the Unspecified singleton).

func SameBorderStroke

func SameBorderStroke(a, b *BorderStroke) bool

7. SameBorderStroke returns true if a and b are the same pointer or both unspecified.

func SemanticEqualBorderStroke

func SemanticEqualBorderStroke(a, b *BorderStroke) bool

8. SemanticEqualBorderStroke checks field-by-field equality.

func StringBorderStroke

func StringBorderStroke(bs *BorderStroke) string

5. StringBorderStroke returns a string representation of BorderStroke.

Types

type BorderStroke

type BorderStroke struct {
	// Width of the border. Use unit.DpHairline for a one-pixel border.
	Width unit.Dp
	// Brush to paint the border with.
	Brush graphics.Brush
}

BorderStroke specifies the stroke to draw a border with.

See: https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/BorderStroke.kt

func CoalesceBorderStroke

func CoalesceBorderStroke(ptr, def *BorderStroke) *BorderStroke

6. CoalesceBorderStroke returns ptr if not nil, otherwise returns def.

func CopyBorderStroke

func CopyBorderStroke(bs *BorderStroke, options ...BorderStrokeOption) *BorderStroke

10. CopyBorderStroke creates a copy with optional modifications.

func MergeBorderStroke

func MergeBorderStroke(a, b *BorderStroke) *BorderStroke

4. MergeBorderStroke merges two BorderStrokes, preferring b's specified values over a's.

func NewBorderStroke

func NewBorderStroke(width unit.Dp, brush graphics.Brush) *BorderStroke

NewBorderStroke creates a new BorderStroke with the given width and brush.

func NewBorderStrokeWithColor

func NewBorderStrokeWithColor(width unit.Dp, color graphics.Color) *BorderStroke

NewBorderStrokeWithColor creates a new BorderStroke with the given width and solid color. This is a convenience function equivalent to NewBorderStroke(width, &graphics.SolidColor{Value: color}).

func TakeOrElseBorderStroke

func TakeOrElseBorderStroke(bs, defaultBS *BorderStroke) *BorderStroke

3. TakeOrElseBorderStroke returns bs if specified, otherwise returns defaultBS.

type BorderStrokeOption

type BorderStrokeOption func(*BorderStroke)

BorderStrokeOption is a functional option for CopyBorderStroke.

func WithBorderStrokeBrush

func WithBorderStrokeBrush(brush graphics.Brush) BorderStrokeOption

WithBorderStrokeBrush sets the brush option.

func WithBorderStrokeWidth

func WithBorderStrokeWidth(width unit.Dp) BorderStrokeOption

WithBorderStrokeWidth sets the width option.

Directories

Path Synopsis
box
row
next
text/input
Package input provides text field state management and editing infrastructure.
Package input provides text field state management and editing infrastructure.
text/input/internal
Package internal provides internal implementation details for text input.
Package internal provides internal implementation details for text input.
text/input/internal/selection
Package selection provides selection state management for text fields.
Package selection provides selection state management for text fields.
text/input/internal/undo
Package undo provides undo/redo infrastructure for text editing.
Package undo provides undo/redo infrastructure for text editing.
text/modifiers
Package modifiers provides text modifier implementations for foundation text components.
Package modifiers provides text modifier implementations for foundation text components.
text/selection
Package selection provides text selection functionality for Compose Foundation.
Package selection provides text selection functionality for Compose Foundation.

Jump to

Keyboard shortcuts

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