Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ModalLayer ¶
type ModalLayer struct {
component.VisibilityAnimation
component.Scrim
Widget func(gtx layout.Context, th *material.Theme, anim *component.VisibilityAnimation) layout.Dimensions
}
ModalLayer is a widget drawn on top of the normal UI that can be populated by other material components modal dialogs. For instance, the App Bar can render its overflow menu within the modal layer, and the modal navigation drawer is entirely within the modal layer.
func (*ModalLayer) Layout ¶
func (m *ModalLayer) Layout(gtx layout.Context, th *material.Theme) layout.Dimensions
Layout renders the modal layer. Unless a modal widget has been triggered, this will do nothing.
type ModalState ¶
type ModalState struct {
component.ScrimState
// contains filtered or unexported fields
}
ModalState defines persistent state for a modal.
type ModalStyle ¶
type ModalStyle struct {
*ModalState
Scrim component.ScrimStyle
}
ModalStyle describes how to layout a modal. Modal content is laid centered atop a clickable scrim.
func Modal ¶
func Modal(th *material.Theme, modal *ModalState) ModalStyle
Modal lays out a content widget atop a clickable scrim. Clicking the scrim dismisses the modal.
func (ModalStyle) Layout ¶
func (m ModalStyle) Layout(gtx layout.Context) layout.Dimensions
Layout the scrim and content. The content is only laid out once the scrim is fully animated in, and is hidden on the first frame of the scrim's fade-out animation.