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

Function itemsToLayout

layout.go:769–793  ·  view source on GitHub ↗
(allItems []LayoutItem)

Source from the content-addressed store, hash-verified

767}
768
769func itemsToLayout(allItems []LayoutItem) []LayoutItem {
770 filteredItems := make([]LayoutItem, 0, len(allItems))
771
772 for i := 0; i < cap(filteredItems); i++ {
773 item := allItems[i]
774
775 if !shouldLayoutItem(item) {
776 continue
777 }
778
779 var idealSize Size
780 if hfw, ok := item.(HeightForWidther); !ok || !hfw.HasHeightForWidth() {
781 if is, ok := item.(IdealSizer); ok {
782 idealSize = is.IdealSize()
783 }
784 }
785 if idealSize.Width == 0 && idealSize.Height == 0 && item.LayoutFlags() == 0 {
786 continue
787 }
788
789 filteredItems = append(filteredItems, item)
790 }
791
792 return filteredItems
793}
794
795func anyVisibleItemInHierarchy(item LayoutItem) bool {
796 if item == nil || !item.Visible() {

Callers 2

MinSizeForSizeMethod · 0.85
PerformLayoutMethod · 0.85

Calls 4

shouldLayoutItemFunction · 0.85
HasHeightForWidthMethod · 0.65
IdealSizeMethod · 0.65
LayoutFlagsMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…