~eliasnaur/gio

Improvement to system.FrameEvent.Insets

Details
Message ID
<CANtNKfo6X6_Mv5ig6WxrCybncpC7zNUHrJ=RMbuhnHuNQA=Zcw@mail.gmail.com>
DKIM signature
pass
Download raw message
With change https://git.sr.ht/~eliasnaur/gio/commit/e124865
handling system.FrameEvent.Insets is not needed anymore.
The inset handling is needed in most cases and is easy to
forget and is boilerplate.

`layout.NewContext` will add the necessary insets
when they are present in the frame event.

To use the old behavior, you need to clear Insets in the event:

    e.Insets = system.Insets{}
    ctx := layout.NewContext(ops, e)

+ Egon
Reply to thread Export thread (mbox)