(widget Widget, ctx *LayoutContext)
| 19 | } |
| 20 | |
| 21 | func createLayoutItemForWidgetWithContext(widget Widget, ctx *LayoutContext) LayoutItem { |
| 22 | var item LayoutItem |
| 23 | |
| 24 | if container, ok := widget.(Container); ok { |
| 25 | if container.Layout() == nil { |
| 26 | return nil |
| 27 | } |
| 28 | |
| 29 | item = CreateLayoutItemsForContainerWithContext(container, ctx) |
| 30 | } else { |
| 31 | item = widget.CreateLayoutItem(ctx) |
| 32 | } |
| 33 | |
| 34 | lib := item.AsLayoutItemBase() |
| 35 | lib.ctx = ctx |
| 36 | lib.handle = widget.Handle() |
| 37 | lib.visible = widget.AsWidgetBase().visible |
| 38 | lib.geometry = widget.AsWidgetBase().geometry |
| 39 | lib.geometry.Alignment = widget.Alignment() |
| 40 | lib.geometry.MinSize = widget.MinSizePixels() |
| 41 | lib.geometry.MaxSize = widget.MaxSizePixels() |
| 42 | lib.geometry.ConsumingSpaceWhenInvisible = widget.AlwaysConsumeSpace() |
| 43 | |
| 44 | return item |
| 45 | } |
| 46 | |
| 47 | func CreateLayoutItemsForContainer(container Container) ContainerLayoutItem { |
| 48 | ctx := newLayoutContext(container.Handle()) |
no test coverage detected
searching dependent graphs…