Skip to content

Commit

Permalink
space and stretch must not render
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoreilly committed Apr 16, 2024
1 parent 879abed commit 29fec7a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/layout.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,12 @@ func ChildByLabelCanFocus(ly *Layout, name string, after tree.Node) tree.Node {
return nil
}

///////////////////////////////////////////////////////////
// Stretch and Space: spacing elements for layouts
// Stretch and Space: spacing elements for layouts

// Stretch adds a stretchy element that grows to fill all
// available space. You can set [styles.Style.Grow] to change
// how much it grows relative to other growing elements.
// It does not render anything.
type Stretch struct {
WidgetBase
}
Expand All @@ -461,9 +461,12 @@ func (st *Stretch) OnInit() {
})
}

func (st *Stretch) Render() {}

// Space is a fixed size blank space, with
// a default width of 1ch and a height of 1em.
// You can set [styles.Style.Min] to change its size.
// It does not render anything.
type Space struct {
WidgetBase
}
Expand All @@ -480,3 +483,5 @@ func (sp *Space) OnInit() {
s.Border.Width.Zero()
})
}

func (sp *Space) Render() {}

0 comments on commit 29fec7a

Please sign in to comment.