Type ButtonRow

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

ButtonRow is a row of buttons against the right edge of an area: the footer of a card, a panel or a dialog.

Constructors

BeginButtonRow#

func BeginButtonRow(canvas *ui.Canvas, theme ui.Theme, area ui.Rect) ButtonRow

BeginButtonRow declares a row of small buttons inside area. The buttons are vertically centered in it.

Methods

Disabled#

func (row ButtonRow) Disabled() ButtonRow

Disabled keeps every button in the semantic tree while making them inert.

Paint#

func (row ButtonRow) Paint(actions ...ButtonAction)

Paint paints the buttons in the order given, so the last one sits at the corner. Each is as wide as its own label needs (the button's padding included) and neighbours are one item gap apart; when they cannot all fit they shrink together.

components.BeginButtonRow(canvas, theme, footer).Paint(
	components.ButtonAction{ID: cancelID, Label: "Cancel", Variant: components.ButtonOutline},
	components.ButtonAction{ID: saveID, Label: "Save"},
)

Size#

func (row ButtonRow) Size(size ButtonSize) ButtonRow

Size picks the buttons' size instead of the small default, for a row that has to fit a bar shorter than a footer: XSmall is 24px at default density.