SystemPopover
QuickGUI の内容を独立したネイティブ子ウィンドウに表示し、親ウィンドウの外側にも広げられます。
#インポート
github.com/egoist/quickgui/go/ui から ui をインポートします。
import (
"github.com/egoist/quickgui/go/ui"
)#使い方
func SystemPopoverExample() *ui.Element {
popover := ui.NewSystemPopover()
return popover.Root().Children(
popover.Trigger().Child("Account"),
popover.Content(ui.PopoverContentProps{Width: 240, Height: 120, Placement: "bottom-start"}).Child("Account settings"),
)
}#構成
systemPopover.RootsystemPopover.TriggersystemPopover.Content
#API リファレンス
項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。
NewSystemPopover
ソースを見るui.NewSystemPopover(props ...PopoverRootProps) *SystemPopoverComponentNewSystemPopover declares a SystemPopover instance. Optional props provide initial settings.
ChildrenComponent—
Content mounted inside the component. Compound child callbacks run after the parent context exists.
Componentソースを見るOpenfunc() bool—
DefaultOpenbool—
OnOpenChangefunc(bool, PopoverOpenChangeDetails)—
Reports a requested visibility change, including dismissal.
func(bool, PopoverOpenChangeDetails)ソースを見るDismissOnEscape*bool—
DismissOnPointerOutside*bool—
Modal*bool—
OpenOnHover*bool—
Delayany—
CloseDelayany—
OnPlacementChangefunc(AnchorPlacementDetails, *native.Event)—
Callback for placement change. The signature below lists the event payload.
func(AnchorPlacementDetails, *native.Event)ソースを見るSidePopoverSide—
AlignPopoverAlign—
SideOffset*float64—
AlignOffset*float64—
CollisionPadding*float64—
Sticky*bool—
Anchor*native.Node—
SystemPopover.Open
ソースを見るsystemPopover.Open(value any) *SystemPopoverComponentControlled visibility of the panel or overlay. Pair with the open-change callback.
SystemPopover.DefaultOpen
ソースを見るsystemPopover.DefaultOpen(value bool) *SystemPopoverComponentInitial visibility when the component owns its open state.
SystemPopover.OnOpenChange
ソースを見るsystemPopover.OnOpenChange(value func(bool, PopoverOpenChangeDetails)) *SystemPopoverComponentReports a requested visibility change, including dismissal.
SystemPopover.DismissOnEscape
ソースを見るsystemPopover.DismissOnEscape(value bool) *SystemPopoverComponentAllows Escape to dismiss the surface.
SystemPopover.DismissOnPointerOutside
ソースを見るsystemPopover.DismissOnPointerOutside(value bool) *SystemPopoverComponentAllows a pointer press outside the surface to dismiss it.
SystemPopover.Modal
ソースを見るsystemPopover.Modal(value bool) *SystemPopoverComponentContains focus and blocks interaction behind the surface.
SystemPopover.OpenOnHover
ソースを見るsystemPopover.OpenOnHover(value bool) *SystemPopoverComponentOpens the surface when its trigger is hovered.
SystemPopover.Delay
ソースを見るsystemPopover.Delay(value any) *SystemPopoverComponentCore-owned delay in milliseconds before opening.
SystemPopover.CloseDelay
ソースを見るsystemPopover.CloseDelay(value any) *SystemPopoverComponentCore-owned delay in milliseconds before closing.
SystemPopover.OnPlacementChange
ソースを見るsystemPopover.OnPlacementChange(value func(AnchorPlacementDetails, *native.Event)) *SystemPopoverComponentCallback for placement change. The signature below lists the event payload.
SystemPopover.Side
ソースを見るsystemPopover.Side(value PopoverSide) *SystemPopoverComponentPreferred placement side before collision handling.
SystemPopover.Align
ソースを見るsystemPopover.Align(value PopoverAlign) *SystemPopoverComponentPreferred alignment on the placement cross-axis.
SystemPopover.SideOffset
ソースを見るsystemPopover.SideOffset(value float64) *SystemPopoverComponentDistance from the anchor on the chosen side, in logical pixels.
SystemPopover.AlignOffset
ソースを見るsystemPopover.AlignOffset(value float64) *SystemPopoverComponentOffset along the anchor’s cross axis, in logical pixels.
SystemPopover.CollisionPadding
ソースを見るsystemPopover.CollisionPadding(value float64) *SystemPopoverComponentSpace reserved between the positioned surface and the available viewport edges.
SystemPopover.Sticky
ソースを見るsystemPopover.Sticky(value bool) *SystemPopoverComponentKeeps the positioned surface attached to its anchor within available bounds.
SystemPopover.Anchor
ソースを見るsystemPopover.Anchor(value *native.Node) *SystemPopoverComponentElement used as the placement anchor for this surface.
SystemPopover.Root
ソースを見るsystemPopover.Root() *ElementConfigures root for this part. The declared type and source define the accepted value.
SystemPopover.Trigger
ソースを見るsystemPopover.Trigger(options ...PopoverTriggerProps) *ElementConfigures trigger for this part. The declared type and source define the accepted value.
Reffunc(*native.Node)—
Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.
func(*native.Node)ソースを見るStyleany—
Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.
anyソースを見るChildrenPartChildren—
Content mounted inside the component. Compound child callbacks run after the parent context exists.
PartChildrenソースを見るDisabledany—
Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.
anyソースを見るRolestring—
FocusOnPointerany—
Groupany—
AriaLabelany—
TabIndex*float64—
Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.
*float64ソースを見るOnClickfunc(*native.Event)—
Called after QuickGUI resolves an activation, including supported keyboard activation.
func(*native.Event)ソースを見るOnDoubleClickfunc(*native.Event)—
OnContextMenufunc(*native.Event)—
OnPointerfunc(*native.Event)—
OnMouseEnterfunc(*native.Event)—
OnMouseLeavefunc(*native.Event)—
OnMouseDownfunc(*native.Event)—
OnMouseUpfunc(*native.Event)—
OnKeyDownfunc(*native.Event)—
OnKeyUpfunc(*native.Event)—
OnFocusfunc(*native.Event)—
OnBlurfunc(*native.Event)—
OpenOnHover*bool—
Delayany—
CloseDelayany—
SystemPopover.Content
ソースを見るsystemPopover.Content(options ...PopoverContentProps) *ElementConfigures content for this part. The declared type and source define the accepted value.
Reffunc(*native.Node)—
Receives the retained native node after construction. Keep imperative work in event or lifecycle callbacks.
func(*native.Node)ソースを見るStyleany—
Reusable layout, typography, color, and interaction-state styles. Build with ui.Style() and compose with Merge.
anyソースを見るChildrenPartChildren—
Content mounted inside the component. Compound child callbacks run after the parent context exists.
PartChildrenソースを見るDisabledany—
Prevents activation and exposes the disabled state to accessibility. Compound parts inherit a disabled root.
anyソースを見るRolestring—
FocusOnPointerany—
Groupany—
AriaLabelany—
TabIndex*float64—
Controls sequential keyboard focus order. Omit to retain the component’s default focus behavior.
*float64ソースを見るOnClickfunc(*native.Event)—
Called after QuickGUI resolves an activation, including supported keyboard activation.
func(*native.Event)ソースを見るOnDoubleClickfunc(*native.Event)—
OnContextMenufunc(*native.Event)—
OnPointerfunc(*native.Event)—
OnMouseEnterfunc(*native.Event)—
OnMouseLeavefunc(*native.Event)—
OnMouseDownfunc(*native.Event)—
OnMouseUpfunc(*native.Event)—
OnKeyDownfunc(*native.Event)—
OnKeyUpfunc(*native.Event)—
OnFocusfunc(*native.Event)—
OnBlurfunc(*native.Event)—
Widthfloat64—
Heightfloat64—
Placementstring—
Gap*float64—
ViewportMargin*float64—
Element
ソースを見るpart.Child(content).Style(style)Every part returns a fluent element. Strings, numbers, elements, and deferred child factories compose directly.
ChildChild(child any) *Element—
Child appends content and returns this element. Content can be an element, native node, scalar, accessor, or node-returning construction callback.
Child(child any) *Elementソースを見るChildrenChildren(children ...any) *Element—
Children appends multiple children in order without replacing existing content. It also accepts []any, []*Element, and []*native.Node slices as arguments. Read the retained child nodes through element.Node.Children.
Children(children ...any) *Elementソースを見るStyleStyle(style StyleBuilder) *Element—
Style merges a reusable style. Scalar accessors retain independent native bindings.
Style(style StyleBuilder) *Elementソースを見るOnClickOnClick(handler func()) *Element—
RefRef(handler func(*native.Node)) *Element—
Ref exposes the native handle once at this point in the declaration chain.
Ref(handler func(*native.Node)) *Elementソースを見る