styleSizeUpdate updates styling size values for widget and its parent, which should be called after these are updated. Returns true if any changed.
()
| 1569 | // styleSizeUpdate updates styling size values for widget and its parent, |
| 1570 | // which should be called after these are updated. Returns true if any changed. |
| 1571 | func (wb *WidgetBase) styleSizeUpdate() bool { |
| 1572 | pwb := wb.parentWidget() |
| 1573 | if pwb == nil { |
| 1574 | return false |
| 1575 | } |
| 1576 | if !wb.updateParentRelSizes() { |
| 1577 | return false |
| 1578 | } |
| 1579 | scsz := wb.Scene.sceneGeom.Size |
| 1580 | sz := wb.Geom.Size.Alloc.Content |
| 1581 | psz := pwb.Geom.Size.Alloc.Content |
| 1582 | chg := wb.Styles.UnitContext.SetSizes(float32(scsz.X), float32(scsz.Y), sz.X, sz.Y, psz.X, psz.Y) |
| 1583 | if chg { |
| 1584 | wb.Styles.ToDots() |
| 1585 | } |
| 1586 | return chg |
| 1587 | } |
| 1588 | |
| 1589 | // Position uses the final sizes to set relative positions within layouts |
| 1590 | // according to alignment settings. |
no test coverage detected