MCPcopy
hub / github.com/lxn/walk / LayoutFlags

Method LayoutFlags

gridlayout.go:349–374  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

347}
348
349func (li *gridLayoutItem) LayoutFlags() LayoutFlags {
350 var flags LayoutFlags
351
352 if len(li.children) == 0 {
353 return ShrinkableHorz | ShrinkableVert | GrowableHorz | GrowableVert
354 } else {
355 for _, item := range li.children {
356 if s, ok := item.(*spacerLayoutItem); ok && s.greedyLocallyOnly || !shouldLayoutItem(item) {
357 continue
358 }
359
360 wf := item.LayoutFlags()
361
362 if wf&GreedyHorz != 0 && item.Geometry().MaxSize.Width > 0 {
363 wf &^= GreedyHorz
364 }
365 if wf&GreedyVert != 0 && item.Geometry().MaxSize.Height > 0 {
366 wf &^= GreedyVert
367 }
368
369 flags |= wf
370 }
371 }
372
373 return flags
374}
375
376func (li *gridLayoutItem) IdealSize() Size {
377 return li.MinSize()

Callers

nothing calls this directly

Calls 3

shouldLayoutItemFunction · 0.85
LayoutFlagsMethod · 0.65
GeometryMethod · 0.65

Tested by

no test coverage detected