widget: [API] move Decorations state update to Actions

Similar to a previous change for Clickable and Bool this change separates
state changes from Decorations.Layout to Actions so that access may
happen before Layout.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2023-10-02 17:22:12 -05:00
parent dc97871122
commit b9837def5c
3 changed files with 31 additions and 25 deletions
+1 -1
View File
@@ -1024,7 +1024,7 @@ func (w *Window) decorate(d driver, e system.FrameEvent, o *op.Ops) (size, offse
}
style.Layout(gtx)
// Update the window based on the actions on the decorations.
w.Perform(deco.Actions())
w.Perform(deco.Update(gtx))
// Offset to place the frame content below the decorations.
decoHeight := gtx.Dp(w.decorations.Config.decoHeight)
if w.decorations.currentHeight != decoHeight {