github.com/jmigpin/editor@v1.6.0/util/uiutil/widget/separator.go (about) 1 package widget 2 3 type Separator struct { 4 Rectangle 5 Handle *SeparatorHandle 6 } 7 8 func NewSeparator(ctx ImageContext, ml *MultiLayer) *Separator { 9 s := &Separator{ 10 Rectangle: *NewRectangle(ctx), 11 } 12 s.Handle = NewSeparatorHandle(s) 13 ml.SeparatorLayer.Append(s.Handle) 14 return s 15 } 16 17 func (s *Separator) Close() { 18 // remove handle from multilayer 19 s.Handle.Parent.Remove(s.Handle) 20 } 21 22 func (s *Separator) Layout() { 23 s.Rectangle.Layout() 24 s.Handle.Layout() 25 }